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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 4 18:31:20 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-04 18:31:20 -0400 (Fri, 04 Apr 2008)
New Revision: 3894

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java
Log:
JBREM-934: In init(), moved MBeanServer.isRegistered() inside  AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java	2008-04-04 22:27:34 UTC (rev 3893)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java	2008-04-04 22:31:20 UTC (rev 3894)
@@ -434,28 +434,30 @@
             try
             {
                final ObjectName objName = new ObjectName(invoker.getMBeanObjectName());
-               if (!server.isRegistered(objName))
-               {  
-                  try
+
+               try
+               {
+                  AccessController.doPrivileged( new PrivilegedExceptionAction()
                   {
-                     AccessController.doPrivileged( new PrivilegedExceptionAction()
+                     public Object run() throws Exception
                      {
-                        public Object run() throws Exception
+                        if (!server.isRegistered(objName))
                         {
                            server.registerMBean(invoker, objName);
-                           return null;
                         }
-                     });
-                  }
-                  catch (PrivilegedActionException e)
-                  {
-                     throw (Exception) e.getCause();
-                  }
+                        else
+                        {
+                           log.warn(objName + " is already registered with MBeanServer");
+                        }
+                        return null;
+                     }
+                  });
                }
-               else
+               catch (PrivilegedActionException e)
                {
-                  log.warn(objName + " is already registered with MBeanServer");
+                  throw (Exception) e.getCause();
                }
+
             }
             catch (Throwable e)
             {




More information about the jboss-remoting-commits mailing list