|
|
||
Jean-Francois Arcand's Blog
«Extending the Grizzly HTTP Runtime |
Main
| Extending the Grizzly HTTP Runtime part III: Gathering Monster's Statistics »
Extending the Grizzly HTTP Runtime part II: Managing the monster using JMXPosted by jfarcand on July 08, 2008 at 04:07 PM | Comments (0)Now that we are all able to create Grizzly Web Server in less than 10 lines, let's complicate our day and add JMX management to the monster In part I, I've described how easy it is to create synchronous and asynchronous http based Web Server. One of the most complicated example was: That wasn't too difficult, was it? Now let's add JMX support: To enable JMX, you just need to implement the Management interface, and set it using the enableJMX method of the GrizzlyWebServer class. As you can see, you can plug your own JMX implementation easily using the Management interface. In the example above, I've just used the Apache Commons Modeler, which does all the JMX "bla bla bla" for me via its org.apache.commons.modeler.Registry static class. To see it live, I just do: Hey hey I can see:
Miaaaaaam! Next time I will explain how to grab statistics from your embedded GrizzlyWebServer, like number of requests, time spend, thread pool stats, etc. You can download the example above here. The binary can be used as it is and include all the Grizzly required classes to run.
technorati: grizzly web server embedded jmx Bookmark blog post: CommentsComments are listed in date ascending order (oldest first) | Post Comment | ||
|
|