[jboss-remoting-commits] JBoss Remoting SVN: r4734 - remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Nov 20 12:31:05 EST 2008


Author: ron.sigal at jboss.com
Date: 2008-11-20 12:31:04 -0500 (Thu, 20 Nov 2008)
New Revision: 4734

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java
Log:
JBREM-1067: Moved JNDI operations to SecurityUtility for new jnpserver.jar.

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-11-20 17:29:08 UTC (rev 4733)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/detection/jndi/JNDIDetector.java	2008-11-20 17:31:04 UTC (rev 4734)
@@ -277,7 +277,7 @@
          cleanDetectionCount++;
          boolean cleanDetect = cleanDetectionCount > detectionNumber;
          String bindName = "";
-         NamingEnumeration enumeration = context.listBindings(bindName);
+         NamingEnumeration enumeration = SecurityUtility.listBindings(context, bindName);
          while(enumeration.hasMore())
          {
             Binding binding = (Binding) enumeration.next();
@@ -414,7 +414,7 @@
       {
          try
          {
-            context.rebind(sId, msg);
+            SecurityUtility.rebind(context, sId, msg);
             log.info("Added " + sId + " to registry.");
          }
          catch(NameAlreadyBoundException nabex)
@@ -502,18 +502,18 @@
       InitialContext initialContext = new InitialContext(env);
       try
       {
-         context = (Context) initialContext.lookup(subContextName);
+         context = SecurityUtility.initialContextLookup(initialContext, subContextName);
       }
       catch(NamingException e)
       {
          try
          {
-            context = initialContext.createSubcontext(subContextName);
+            context = SecurityUtility.createSubcontext(initialContext, subContextName);
          }
          catch(NameAlreadyBoundException e1)
          {
             log.debug("The sub context " + subContextName + " was created before we could.");
-            context = (Context) initialContext.lookup(subContextName);
+            context = SecurityUtility.initialContextLookup(initialContext, subContextName);
          }
       }
    }
@@ -545,6 +545,6 @@
       {
          log.trace("unregistering detector " + sId);
       }
-      context.unbind(sId);
+      SecurityUtility.unbind(context, sId);
    }
 }




More information about the jboss-remoting-commits mailing list