registry = LocateRegistry.createRegistry(rmiRegistryPort, clientSocketFactory, serverSocketFactory);
HashMap env = new HashMap();
if( securityDomain != null)
env.put(RMIConnectorServer.AUTHENTICATOR, new JMXConnectorAuthenticator( securityDomain) );
// note: don't pass clientSocketFactory to RMIJRMPServerImpl ctor or JBAS-7933 regression will occur.
rmiServer = new RMIJRMPServerImpl(rmiServerPort, null, serverSocketFactory, env);
JMXServiceURL url = buildJMXServiceURL();
adapter = new RMIConnectorServer(url, env, rmiServer, wrapMBeanServer(mbeanServer));
adapter.start();
url = adapter.getAddress();
registry.rebind(RMI_BIND_NAME, rmiServer.toStub());