<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<!-- =============================================================== -->
<!-- Configure the JVM JMX Server                                    -->
<!-- this configuration file should be used in combination with      -->
<!-- other configuration files.  e.g.                                -->
<!--    java -DOPTIONS=jmx -jar start.jar etc/jetty-jmx.xml etc/jetty.xml  -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">

    <!-- =========================================================== -->
    <!-- Initialize an mbean server                                  -->
    <!-- =========================================================== -->
    <Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>

    <!-- =========================================================== -->
    <!-- Initialize the Jetty MBean container                        -->
    <!-- =========================================================== -->
    <New id="MBeanContainer" class="org.eclipse.jetty.jmx.MBeanContainer">
      <Arg><Ref id="MBeanServer"/></Arg>
    </New>

    <!-- Add to the Server to listen for object events -->
    <Get id="Container" name="container">
      <Call name="addEventListener">
        <Arg><Ref id="MBeanContainer"/></Arg>
      </Call>
    </Get>

    <!-- Add to the Server as a lifecycle -->
    <!-- Only do this if you know you will only have a single jetty server -->
    <Call name="addBean">
      <Arg><Ref id="MBeanContainer"/></Arg>
    </Call>

    <!-- Add the static log -->
    <Get id="Logger" class="org.eclipse.jetty.util.log.Log" name="log"/>
    <Ref id="MBeanContainer">
      <Call name="addBean">
          <Arg><Ref id="Logger"/></Arg>
      </Call>
    </Ref>

    <!-- optionally add a remote JMX connector 
    <Call id="jmxConnector" class="javax.management.remote.JMXConnectorServerFactory" name="newJMXConnectorServer">
      <Arg>
        <New  class="javax.management.remote.JMXServiceURL">
          <Arg>service:jmx:rmi:///jndi/rmi:///jettymbeanserver</Arg>
        </New>
      </Arg>
      <Arg/>
      <Arg><Ref id="MBeanServer"/></Arg>
      <Call name="start"/>
    </Call>
    -->
    
</Configure>

