Skip to main content

Blog Archive for survivant during November 2008

It's now possible to be notify when a client disconnect for a server build on Grizzly 1.9+. here a little snippets that will allow you that.  Thanks to the new ConnectionCloseHandler. public void init(){                int port = 5000;                try {  ...
Suppose that you are dealing with sql query that you send to a database.  Some query could take few seconds to run, that will block a Thread.  Even if you have few Threads in your pool, they could all be stuck there too.  To avoid that you can use the Producer/Consumer pattern. Take a look at this snippets. .... // default Pipeline settingsPipeline pipeline = new DefaultPipeline();...
I wanted to add Cobertura to Grizzly project within the pom file for Maven, but I got errors at first. I follow the procedure describe on Cobertura website, but it was lacking of a complete example. Cobertura will instrument your classes and you need to run tests to get a test coverage. You need to pass the path of these instrumented classes to the plugin that will run the tests(in the same...
There are so many browsers and version of theses browsers that I became harder to create HTML that will run on all the possibles combinations. You need the appropriate tools to help you to debug. There are few application and plugins you need to try : - Firebug for Firefox (https://addons.mozilla.org/fr/firefox/addon/1843) : to debug everything : html, css, javascript, ajax ... - Markup...
I created a new logging formatter for Grizzly, because when we were debugging a test we weren't able to trace in the log the event because the default formatter in java.util.logging doesn't print the Thread that log the event. (ouff.. that a long line) The new formatter is : com.sun.grizzly.util.LoggingFormatter It's based on java.util.logging.SimpleFormatter. It's really simple to change the...