JPOX provides MBeans that can be used to monitor, manage and configure JPOX at runtime. More about
JMX here. To enable this
you must specify the persistence property org.jpox.managedRuntime as true when creating the
PMF/EMF.
JPOX MBeans are registered in a MBean Server when JPOX is started up (e.g. upon JDO PMF or JPA EMF
instantiation). To see the full list of JPOX MBeans, refer to the
javadocs.
A MBean server is bundled with Sun JRE since its version 1.5, and you can easily activate
JPOX MBeans registration by adding the JPOX Management Platform plugin (org.jpox.management.platform)
found in jar jpox-management-{version}.jar to the classpath.
Additionaly, setting a few system properties are necessary for configuring the Sun JMX implementation.
The minimum properties required are the following:
- com.sun.management.jmxremote
- com.sun.management.jmxremote.authenticate
- com.sun.management.jmxremote.ssl
- com.sun.management.jmxremote.port=<port number>
Usage example:
java -cp TheClassPathInHere
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=8001
TheMainClassInHere
Once you start your application and JPOX is initialized you can browse JPOX MBeans using
a tool called jconsole (jconsole is distributed with the Sun JDK) via the URL:
service:jmx:rmi:///jndi/rmi://hostName:portNum/jmxrmi
Note that the mode of usage is presented in this document as matter of example, and by no means
we recommend to disable authentication and secured communication channels. Further details on the
Sun JMX implementation and how to configure it properly can be found in
here.