nsmbean.start();
// Create the JRMP adaptor
ObjectName adaptor = new ObjectName("Adaptor:protocol=JRMP");
mserver.createMBean("mx4j.adaptor.rmi.jrmp.JRMPAdaptor", adaptor, null);
JRMPAdaptorMBean jrmpmbean = (JRMPAdaptorMBean)StandardMBeanProxy.create(JRMPAdaptorMBean.class, mserver, adaptor);
// Set the JNDI name with which will be registered
String jndiName = "jrmp";
jrmpmbean.setJNDIName(jndiName);
String lHost = host;
if (lHost == null)
lHost = "localhost";
else if (lHost.length() == 0)
lHost = InetAddress.getLocalHost().getHostName();
log( "Started mx4j jrmp adaptor" + ((host != null) ? " for host " + host : "") + " at port " + port);
jrmpmbean.putJNDIProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.rmi.registry.RegistryContextFactory");
jrmpmbean.putJNDIProperty(javax.naming.Context.PROVIDER_URL, "rmi://" + lHost + ":" + port);
jrmpmbean.start();
}
catch( Throwable t )
{
log("Can't load MX4J JRMP adaptor" + t.toString() );