public final synchronized void start ( ) throws IOException { LaunchingMessageKind . IJMX0001 . format ( this . host , this . port ) ; this . mbs = ManagementFactory . getPlatformMBeanServer ( ) ; final String oldRmiServerName = System . getProperty ( "java.rmi.server.hostname" ) ; System . setProperty ( "java.rmi.server.hostname" , this . host ) ; register = LocateRegistry . createRegistry ( this . port ) ; if ( oldRmiServerName == null ) { final Properties props = System . getProperties ( ) ; for ( Object key : props . keySet ( ) ) { if ( key . equals ( "java.rmi.server.hostname" ) ) { props . remove ( key ) ; break ; } } } else { System . setProperty ( "java.rmi.server.hostname" , oldRmiServerName ) ; } final String serviceURL = String . format ( serverUrlFormat , this . host , this . host , this . port ) ; LaunchingMessageKind . IJMX0002 . format ( serviceURL ) ; final JMXServiceURL url = new JMXServiceURL ( serviceURL ) ; this . jmxConnectorServer = JMXConnectorServerFactory . newJMXConnectorServer ( url , null , mbs ) ; this . jmxConnectorServer . start ( ) ; registerMBeans ( ) ; }
Start the JMX Server