List of usage examples for javax.management.remote.rmi RMIConnectorServer isActive
public synchronized boolean isActive()
From source file:org.nuxeo.runtime.management.ServerLocatorService.java
protected MBeanServer doCreateServer(final ServerLocatorDescriptor descriptor) { MBeanServer server = MBeanServerFactory.createMBeanServer(); JMXServiceURL url = doFormatServerURL(descriptor); if (!descriptor.remote) { return server; }/*from ww w .j a va2 s . c o m*/ final RMIConnectorServer connector; try { connector = new RMIConnectorServer(url, null, server); } catch (IOException e) { throw new ManagementRuntimeException("Cannot start connector for " + descriptor.domainName, e); } try { connector.start(); } catch (IOException e) { try { LocateRegistry.createRegistry(descriptor.rmiPort); } catch (RemoteException e2) { throw new ManagementRuntimeException("Cannot start RMI connector for " + descriptor.domainName, e); } try { connector.start(); } catch (IOException e2) { throw new ManagementRuntimeException("Cannot start RMI connector for " + descriptor.domainName, e2); } } assert connector.isActive(); log.info("Started a mbean server : " + url); return server; }