Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Jetty/Feature/JMX
Contents
Introduction
The Jetty JMX integration is based on the ObjectMBean implementation of DynamicMBean. This implementation allows an arbitrary POJO to be wrapped in an MBean and for meta data to be provided by properties files
The creation of MBeans is coordinated by the MBeanContainer implementation of the Container.Listener interface. The Jetty Server and it's components use a Container to maintain a containment tree of components and to support notification of changes to that tree. The MBeanContainer class listens for Container events and creates and destroys MBeans as required to wrap all Jetty components.
Feature
Using Jetty MBeans
The simplest way to use Jetty MBeans is to use the JVM supplied JConsole utility. An internal HTTP agent can also be used (see jetty-jmx.xml config file comments).
See [Run Jetty with JConsole] for instructions on how to configure jmx for use with Sun's JConsole.
Jetty Standalone
The MBeanContainer instance can be configured for a Jetty server by the jetty-jmx.xml configuration file. This can be run with the standard configuration file as follows:java -jar start.jar etc/jetty-jmx.xml etc/jetty.xml
java -DOPTIONS=jmx -jar start.jar etc/jetty-jmx.xml etc/jetty.xml
Jetty Maven Plugin
If you are using the Jetty Maven plugin you should copy the etc/jetty-jmx.xml file into your webapp project somewhere, such as src/etc, then add a <jettyconfig> element to the plugin <configuration>:<plugin> <groupid>org.mortbay.jetty</groupid> <artifactid>maven-jetty-plugin</artifactid> <version>${project.version}</version> <configuration> <scanintervalseconds>10</scanintervalseconds> <jettyconfig>src/etc/jetty-jmx.xml</jettyconfig> </configuration> </plugin>
Additional Resources
See [Run Jetty with JConsole] for instructions on how to configure jmx for use with Sun's JConsole.