jqmlogger.trace("registering remote agent");
try
{
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
JndiContext ctx = (JndiContext) NamingManager.getInitialContext(null);
ctx.registerRmiContext(LocateRegistry.createRegistry(registryPort));
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://" + hostname + ":" + serverPort + "/jndi/rmi://" + hostname + ":"
+ registryPort + "/jmxrmi");
JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mbs);