1<?xml version="1.0"?>
2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
3
4<!-- ============================================================================ -->
5<!-- To correctly start Jetty with JMX module enabled, this configuration         -->
6<!-- file must appear first in the list of the configuration files.               -->
7<!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the          -->
8<!-- first file in configuration file list at the end of start.ini file.          -->
9<!-- ============================================================================ -->
10<Configure id="Server" class="org.eclipse.jetty.server.Server">
11
12  <!-- =========================================================== -->
13  <!-- Set the java.rmi.server.hostname property in case you've    -->
14  <!-- got a misconfigured /etc/hosts entry or the like.           -->
15  <!-- =========================================================== -->
16  <!--
17  <Call class="java.lang.System" name="setProperty">
18    <Arg>java.rmi.server.hostname</Arg>
19    <Arg>127.0.0.1</Arg>
20  </Call>
21  -->
22
23  <!-- =========================================================== -->
24  <!-- Initialize an mbean server                                  -->
25  <!-- =========================================================== -->
26  <Call id="MBeanServer" class="java.lang.management.ManagementFactory"
27    name="getPlatformMBeanServer" />
28
29  <!-- =========================================================== -->
30  <!-- Initialize the Jetty MBean container                        -->
31  <!-- =========================================================== -->
32  <New id="MBeanContainer" class="org.eclipse.jetty.jmx.MBeanContainer">
33    <Arg><Ref id="MBeanServer" /></Arg>
34    <Call name="start"/>
35  </New>
36
37  <!-- Add to the Server to listen for object events -->
38  <Get id="Container" name="container">
39    <Call name="addEventListener">
40      <Arg><Ref id="MBeanContainer" /></Arg>
41    </Call>
42  </Get>
43
44  <!-- Add to the Server as a managed lifecycle -->
45  <Call name="addBean">
46    <Arg><Ref id="MBeanContainer"/></Arg>
47    <Arg type="boolean">true</Arg>
48  </Call>
49
50  <!-- Add the static log -->
51  <Ref id="MBeanContainer">
52    <Call name="addBean">
53      <Arg>
54        <New class="org.eclipse.jetty.util.log.Log"/>
55      </Arg>
56    </Call>
57  </Ref>
58
59  <!-- In order to connect to the JMX server remotely from a different
60       process, possibly running on a different host, Jetty JMX module
61       can create a remote JMX connector. It requires RMI registry to
62       be started prior to creating the connector server because the
63       JMX specification uses RMI to facilitate connections.
64   -->
65
66  <!-- Optionally start the RMI registry. Normally RMI registry runs on
67       port 1099. The argument below can be changed in order to comply
68       with the firewall requirements.
69  -->
70  <!--
71  <Call name="createRegistry" class="java.rmi.registry.LocateRegistry">
72    <Arg type="java.lang.Integer"><SystemProperty name="jetty.jmxrmiport" default="1099"/></Arg>
73    <Call name="sleep" class="java.lang.Thread">
74       <Arg type="java.lang.Integer">1000</Arg>
75    </Call>
76  </Call>
77  -->
78
79  <!-- Optionally add a remote JMX connector. The parameters of the constructor
80       below specify the JMX service URL, and the object name string for the
81       connector server bean. The parameters of the JMXServiceURL constructor
82       specify the protocol that clients will use to connect to the remote JMX
83       connector (RMI), the hostname of the server (local hostname), port number
84       (automatically assigned), and the URL path. Note that URL path contains
85       the RMI registry hostname and port number, that may need to be modified
86       in order to comply with the firewall requirements.
87  -->
88  <!--
89  <New id="ConnectorServer" class="org.eclipse.jetty.jmx.ConnectorServer">
90    <Arg>
91      <New class="javax.management.remote.JMXServiceURL">
92        <Arg type="java.lang.String">rmi</Arg>
93        <Arg type="java.lang.String" />
94        <Arg type="java.lang.Integer"><SystemProperty name="jetty.jmxrmiport" default="1099"/></Arg>
95        <Arg type="java.lang.String">/jndi/rmi://<SystemProperty name="jetty.jmxrmihost" default="localhost"/>:<SystemProperty name="jetty.jmxrmiport" default="1099"/>/jmxrmi</Arg>
96      </New>
97    </Arg>
98    <Arg>org.eclipse.jetty.jmx:name=rmiconnectorserver</Arg>
99    <Call name="start" />
100  </New>
101  -->
102</Configure>
103
104