From CubeiaWiki

Jump to: navigation, search

To connect to a running Firbase via JMX from another Java process you need to do the following.

Include firebase-jmx artifact.


Then create a connection to the remote Firebase JMX Server

JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();

Then you can create proxy mBeans that you can invoke methods on directly. Remember that all methods call are done remotely so they may take time to execute and can fail mid-call. Below is an example of getting the StateClientRegistryMBean proxy.

ObjectName clientRegistryName = new ObjectName("com.cubeia.firebase.clients:type=ClientRegistry");
StateClientRegistryMBean clientRegistry = JMX.newMBeanProxy(mbsc, clientRegistryName, StateClientRegistryMBean.class, true);

You can read more about what mBeans and methods are exposed in the Firebase JMX Documentation found here:

Personal tools