Jump to: navigation, search

Difference between revisions of "Jetty/Feature/JMX"

< Jetty‎ | Feature
Line 11: Line 11:
| body =  
| body =  
The Jetty [http://java.sun.com/products/JavaManagement/ 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 [http://dev.eclipse.org/viewcvs/index.cgi/jetty/trunk/jetty-jmx/src/main/resources/org/eclipse/jetty/?root=RT_Jetty 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 [http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/util/component/Container.html 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.
=== Using Jetty MBeans  ===
The simplest way to use Jetty MBeans is to use the [http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html JConsole] utility supplied with Sun's Java Virtual Machine. An internal HTTP agent can also be used (see jetty-jmx.xml config file comments).
See [[Jetty/Howto/Run Jetty_with_JConsole|Run Jetty with JConsole]] for instructions on how to configure jmx for use with [http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html 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 OPTIONS=Server,jmx etc/jetty-jmx.xml etc/jetty.xml
=== Jetty Maven Plugin  ===
If you are using the [http://jetty.mortbay.org/maven-plugin/index.html Jetty Maven plugin] you should copy the etc/jetty-jmx.xml file into your webapp project somewhere, such as src/etc, then add a &lt;jettyconfig&gt; element to the plugin &lt;configuration&gt;:
<source lang="xml">
| more =
| more =

Revision as of 18:52, 22 December 2009


The Java Management Extensions (JMX) API is a standard API for management and monitoring of resources such as applications, devices, services, and the Java virtual machine. The JMX technology was developed through the Java Community Process.

Typical uses of the JMX technology include:

  • Consulting and changing application configuration.
  • Accumulating statistics about application behavior and making them available.
  • Notifying of state changes and erroneous conditions.

The JMX API includes remote access, so a remote management program can interact with a running application for these purposes.


Additional Resources

See Run Jetty with JConsole for instructions on how to configure JVM for use with Sun's JConsole.