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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 11 21:41:00 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-11 21:41:00 -0400 (Fri, 11 Apr 2008)
New Revision: 3961

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
Log:
JBREM-934: Replaced AccessController.doPrivileged() call with SecurityUtility.getMethod() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java	2008-04-12 01:40:07 UTC (rev 3960)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/servlet/web/ServerInvokerServlet.java	2008-04-12 01:41:00 UTC (rev 3961)
@@ -27,6 +27,7 @@
 import org.jboss.remoting.InvokerRegistry;
 import org.jboss.remoting.ServerInvoker;
 import org.jboss.remoting.transport.servlet.ServletServerInvokerMBean;
+import org.jboss.remoting.util.SecurityUtility;
 
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -273,24 +274,8 @@
       {
          try
          {
-            final Class c = Class.forName("java.lang.management.ManagementFactory");
-            Method m = null;
-
-            try
-            {
-               m = (Method)AccessController.doPrivileged( new PrivilegedExceptionAction()
-               {
-                  public Object run() throws Exception
-                  {
-                     return c.getMethod("getPlatformMBeanServer", new Class[] {});
-                  }
-               });
-            }
-            catch (PrivilegedActionException e)
-            {
-               throw (Exception) e.getCause();
-            }
-            
+            Class c = Class.forName("java.lang.management.ManagementFactory");
+            Method m = SecurityUtility.getMethod(c, "getPlatformMBeanServer", new Class[] {});
             MBeanServer s = (MBeanServer) m.invoke(null, new Object[] {});
             log.debug("Using platform MBeanServer");
             return s;




More information about the jboss-remoting-commits mailing list