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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 11 20:59:32 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-11 20:59:32 -0400 (Fri, 11 Apr 2008)
New Revision: 3937

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java
Log:
JBREM-934: Replaced AccessController.doPrivileged() calls with SecurityUtility calls..

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java	2008-04-12 00:58:59 UTC (rev 3936)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/detection/multicast/MulticastDetector.java	2008-04-12 00:59:32 UTC (rev 3937)
@@ -23,6 +23,7 @@
 
 import org.jboss.remoting.detection.AbstractDetector;
 import org.jboss.remoting.detection.Detection;
+import org.jboss.remoting.util.SecurityUtility;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -145,38 +146,11 @@
    {
       if(addr == null)
       {
-         try
-         {
-            this.addr = (InetAddress)AccessController.doPrivileged( new PrivilegedExceptionAction()
-            {
-               public Object run() throws IOException
-               {
-                  return InetAddress.getByName(defaultIP);
-               }
-            });
-         }
-         catch (PrivilegedActionException e)
-         {
-            throw (IOException) e.getCause();
-         }
+         addr = SecurityUtility.getAddressByName(defaultIP);
       }
-      // check to see if we're running on a machine with loopback and no NIC
-      InetAddress localHost = null;
-      try
-      {
-         localHost = (InetAddress)AccessController.doPrivileged( new PrivilegedExceptionAction()
-         {
-            public Object run() throws IOException
-            {
-               return InetAddress.getLocalHost();
-            }
-         });
-      }
-      catch (PrivilegedActionException e)
-      {
-         throw (IOException) e.getCause();
-      }
       
+      // check to see if we're running on a machine with loopback and no NIC
+      InetAddress localHost = SecurityUtility.getLocalHost();
       if(bindAddr == null && localHost.getHostAddress().equals("127.0.0.1"))
       {
          // use this to bind so multicast will work w/o network




More information about the jboss-remoting-commits mailing list