[jboss-remoting-commits] JBoss Remoting SVN: r3944 - remoting2/branches/2.x/src/main/org/jboss/remoting/security.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 11 21:06:55 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-11 21:06:55 -0400 (Fri, 11 Apr 2008)
New Revision: 3944

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/security/ServerSocketFactoryWrapper.java
Log:
JBREM-934: Replaced AccessController.doPrivileged() call with SecurityUtility.createServerSocket().

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/security/ServerSocketFactoryWrapper.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/security/ServerSocketFactoryWrapper.java	2008-04-12 01:06:08 UTC (rev 3943)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/security/ServerSocketFactoryWrapper.java	2008-04-12 01:06:55 UTC (rev 3944)
@@ -22,6 +22,9 @@
 package org.jboss.remoting.security;
 
 import javax.net.ServerSocketFactory;
+
+import org.jboss.remoting.util.SecurityUtility;
+
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
@@ -43,82 +46,22 @@
 
    public ServerSocket createServerSocket(final int i) throws IOException
    {
-      ServerSocket ss = null;
-      try
-      {
-          ss = (ServerSocket)AccessController.doPrivileged( new PrivilegedExceptionAction()
-          {
-             public Object run() throws Exception
-             {
-                 return serverSocketFactory.createServerSocket(i);
-             }
-          });
-      }
-      catch (PrivilegedActionException e)
-      {
-          throw (IOException) e.getCause();
-      }
-      return ss;
+      return SecurityUtility.createServerSocket(serverSocketFactory, i);
    }
 
    public ServerSocket createServerSocket(final int i, final int i1) throws IOException
    {
-      ServerSocket ss = null;
-      try
-      {
-          ss = (ServerSocket)AccessController.doPrivileged( new PrivilegedExceptionAction()
-          {
-             public Object run() throws Exception
-             {
-                return serverSocketFactory.createServerSocket(i, i1);
-             }
-          });
-      }
-      catch (PrivilegedActionException e)
-      {
-          throw (IOException) e.getCause();
-      }
-      return ss;
+      return SecurityUtility.createServerSocket(serverSocketFactory, i, i1);
    }
 
    public ServerSocket createServerSocket(final int i, final int i1, final InetAddress inetAddress) throws IOException
    {
-      ServerSocket ss = null;
-      try
-      {
-          ss = (ServerSocket)AccessController.doPrivileged( new PrivilegedExceptionAction()
-          {
-             public Object run() throws Exception
-             {
-                return serverSocketFactory.createServerSocket(i, i1, inetAddress);
-             }
-          });
-      }
-      catch (PrivilegedActionException e)
-      {
-          throw (IOException) e.getCause();
-      }
-      return ss;
+      return SecurityUtility.createServerSocket(serverSocketFactory, i, i1, inetAddress);
    }
 
    public ServerSocket createServerSocket() throws IOException
    {
-      ServerSocket ss = null;
-      try
-      {
-          ss = (ServerSocket)AccessController.doPrivileged( new PrivilegedExceptionAction()
-          {
-             public Object run() throws Exception
-             {
-                return serverSocketFactory.createServerSocket();
-             }
-          });
-      }
-      catch (PrivilegedActionException e)
-      {
-          throw (IOException) e.getCause();
-      }
-      return ss;
+      return serverSocketFactory.createServerSocket();
    }
 
    public ServerSocketFactoryMBean getDelegate()




More information about the jboss-remoting-commits mailing list