JMX MBean Server
Each component loaded in the container will be automatically wrapped by a MBean that will be registered in an associated MBean server. There exist one MBean server per eXo container and you can get the instance from the ExoContainer class using the method
public MBeanServer getMBeanServer()
By default the created MBean will be given a conventional name that you can override from the configuration.xml file using the jmx-name XML tag:
<component>
<key>org.exoplatform.services.database.HibernateService</key>
<jmx-name>exo-service:type=HibernateService</jmx-name>
<type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
[...]
</component>
Before kernel 2.0.7, you can access to your MBeanServers by adding the patch jar attached to this page to your classpath. By default this new component will bind your MBean servers to a RMI registry on localhost at 9999. You will be able to access your MBeans from any JMX Console which supports remote access like the JConsole by using the following URLs :
| Container Type | Access URL |
|---|
| RootContainer or StandaloneContainer | service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root |
| PortalContainer (in Portal mode) | service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root/PORTAL_NAME |
| RepositoryContainer | service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root/PORTAL_NAME/REPOSITORY_NAME in Portal mode or service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root/REPOSITORY_NAME in Standalone mode |
| WorkspaceContainer | service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root/PORTAL_NAME/REPOSITORY_NAME/WORKSPACE_NAME in Portal mode or service:jmx:rmi:///jndi/rmi://localhost:9999/eXo/root/REPOSITORY_NAME/WORKSPACE_NAME in Standalone mode |
You can of course change these properties by overloading them. Here are all the parameters
<init-params>
<value-param>
<name>protocol</name>
<description>protocol is a short string that represent the protocol such as "rmi", "iiop", "jmxmp" or "soap"</description>
<value>rmi:///jndi/rmi</value>
</value-param>
<value-param>
<name>host</name>
<description>optional hostname</description>
<value>localhost</value>
</value-param>
<value-param>
<name>port</name>
<description>optional port</description>
<value>9999</value>
</value-param>
<value-param>
<name>path-prefix</name>
<description>optional path prefix</description>
<value>eXo/</value>
</value-param>
<value-param>
<name>name-separator</name>
<description>the separator used between the container names</description>
<value>/</value>
</value-param>
<properties-param>
<name>environment</name>
<description>a set of attributes to control the new connector server's behaviour</description>
<property name="jmx.remote.jndi.rebind" value="true"/>
</properties-param>
</init-params>
Please, make sure that an RMI registry has been properly started (locally on 9999) before launching eXo. If you use the RMI registry provided in JDK 1.5, you can just launch rmiregistry 9999.
Since kernel 2.0.7, it is possible to register all eXo MBeans in a single local MBeanServer in order to be able to manage them through the JConsole or any another JMX Console.
- The JVM system property org.exoplatform.container.jmx.useExistingServer can set to specify that we would like to use a local MBean server. By default, the default behavior will be preserved.
java -Dorg.exoplatform.container.jmx.useExistingServer ...
- The JVM system property org.exoplatform.container.jmx.findExistingServer can set to specify that we would like to find a specific local MBean server. The value of this parameter is the MBean server agent id. By default, the platform MBean Server will be used.
java -Dorg.exoplatform.container.jmx.findExistingServer=${agent_id} ...
If you have no agent id to set just set the JVM system property without any value as below:
java -Dorg.exoplatform.container.jmx.findExistingServer ...
- The JVM system property org.exoplatform.container.jmx.findExistingServerFromDefaultDomain can set to specify our local MBean server research. The value of this parameter is the MBean server default domain name. By default, only the agent id is used to find the local MBean server so if several MBean servers have the same agent id, the first one will be used.
java -Dorg.exoplatform.container.jmx.findExistingServerFromDefaultDomain=${default_domain} ...