int rmiPort = Integer.parseInt(System.getProperty(REMOTE_JMX_RMI_REGISTRY_PORT, DEFAULT_REMOTE_JMX_RMI_REGISTRY_PORT));
JMXServiceURL serviceURL = JMXServiceURLFactory.getServiceURL(jmxHost, jmxPort + 1, rmiPort, "arquillian-osgi-callback");
try
{
log.debug("Starting JMXConnectorServer on: " + serviceURL);
JMXConnectorServerExt connectorServer = new JMXConnectorServerExt(serviceURL, rmiPort);
connectorServer.start(JMXServerFactory.findOrCreateMBeanServer());
return connectorServer;
}
catch (IOException ex)
{
log.error("Cannot start JMXConnectorServer on: " + serviceURL, ex);