[jboss-cvs] JBossAS SVN: r77836 - trunk/server/src/main/org/jboss.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 3 04:51:45 EDT 2008


Author: adrian at jboss.org
Date: 2008-09-03 04:51:45 -0400 (Wed, 03 Sep 2008)
New Revision: 77836

Modified:
   trunk/server/src/main/org/jboss/Shutdown.java
Log:
[JBAS-5922] - Recognise http(s) jndi urls and modify the initial naming context factory accordingly

Modified: trunk/server/src/main/org/jboss/Shutdown.java
===================================================================
--- trunk/server/src/main/org/jboss/Shutdown.java	2008-09-03 06:48:38 UTC (rev 77835)
+++ trunk/server/src/main/org/jboss/Shutdown.java	2008-09-03 08:51:45 UTC (rev 77836)
@@ -38,6 +38,7 @@
 import gnu.getopt.Getopt;
 import gnu.getopt.LongOpt;
 
+import org.jboss.naming.HttpNamingContextFactory;
 import org.jboss.system.server.Server;
 import org.jboss.system.server.ServerImplMBean;
 import org.jboss.security.SecurityAssociation;
@@ -208,6 +209,9 @@
          Hashtable env = new Hashtable();
          env.put(Context.PROVIDER_URL, serverURL);
          env.put(NamingContext.JNP_DISABLE_DISCOVERY, "true");
+         // This is a hack
+         if (serverURL.startsWith("http:") || serverURL.startsWith("https:"))
+            env.put(Context.INITIAL_CONTEXT_FACTORY, HttpNamingContextFactory.class.getName());
          ctx  = new InitialContext(env);
       }
 




More information about the jboss-cvs-commits mailing list