Author: ron.sigal(a)jboss.com
Date: 2008-09-07 16:39:00 -0400 (Sun, 07 Sep 2008)
New Revision: 4540
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java
Log:
JBREM-1033: Creates NamingBeanImpl for JNDI Main.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java 2008-09-07
05:15:22 UTC (rev 4539)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java 2008-09-07
20:39:00 UTC (rev 4540)
@@ -31,6 +31,7 @@
import org.jboss.remoting.util.SecurityUtility;
import org.jnp.interfaces.NamingContextFactory;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import javax.naming.Binding;
import javax.naming.Context;
@@ -443,6 +444,10 @@
{
log.info("JNDI Server configuration information not present so will
create a local server.");
+ SecurityUtility.setSystemProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
host = SecurityUtility.getLocalHostName();
port = PortUtil.findFreePort(host);
@@ -451,6 +456,7 @@
//If no server information provided, then start one of our own by default
Main server = new Main();
+ server.setNamingInfo(namingBean);
server.setPort(port);
server.setBindAddress(host);
server.start();
Show replies by date