[jboss-remoting-commits] JBoss Remoting SVN: r4541 - in remoting2/branches/2.x/src/main/org/jboss/remoting/samples: transporter/custom/server and 1 other directory.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Sun Sep 7 16:41:39 EDT 2008
Author: ron.sigal at jboss.com
Date: 2008-09-07 16:41:36 -0400 (Sun, 07 Sep 2008)
New Revision: 4541
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/samples/detection/jndi/SimpleJNDIServer.java
remoting2/branches/2.x/src/main/org/jboss/remoting/samples/transporter/custom/server/JNDIServer.java
Log:
JBREM-1033: Creates NamingBeanImpl for JNDI Main.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/samples/detection/jndi/SimpleJNDIServer.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/samples/detection/jndi/SimpleJNDIServer.java 2008-09-07 20:39:00 UTC (rev 4540)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/samples/detection/jndi/SimpleJNDIServer.java 2008-09-07 20:41:36 UTC (rev 4541)
@@ -1,6 +1,8 @@
package org.jboss.remoting.samples.detection.jndi;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import java.net.InetAddress;
@@ -86,10 +88,15 @@
private void setupJNDIServer() throws Exception
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
// start JNDI server
String detectorHost = InetAddress.getLocalHost().getHostName();
Main JNDIServer = new Main();
+ JNDIServer.setNamingInfo(namingBean);
JNDIServer.setPort(detectorPort);
JNDIServer.setBindAddress(detectorHost);
JNDIServer.start();
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/samples/transporter/custom/server/JNDIServer.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/samples/transporter/custom/server/JNDIServer.java 2008-09-07 20:39:00 UTC (rev 4540)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/samples/transporter/custom/server/JNDIServer.java 2008-09-07 20:41:36 UTC (rev 4541)
@@ -21,7 +21,9 @@
*/
package org.jboss.remoting.samples.transporter.custom.server;
+import org.jboss.remoting.util.SecurityUtility;
import org.jnp.server.Main;
+import org.jnp.server.NamingBeanImpl;
import java.net.InetAddress;
@@ -36,9 +38,14 @@
{
try
{
+ SecurityUtility.setSystemProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ NamingBeanImpl namingBean = new NamingBeanImpl();
+ namingBean.start();
+
String host = InetAddress.getLocalHost().getHostAddress();
Main jserver = new Main();
+ jserver.setNamingInfo(namingBean);
int port = JNDI_PORT;
jserver.setPort(port);
jserver.setBindAddress(host);
More information about the jboss-remoting-commits
mailing list