[jboss-remoting-commits] JBoss Remoting SVN: r3862 - remoting2/branches/2.x/src/main/org/jboss/remoting/transporter.
jboss-remoting-commits at lists.jboss.org
jboss-remoting-commits at lists.jboss.org
Wed Apr 2 00:33:47 EDT 2008
Author: ron.sigal at jboss.com
Date: 2008-04-02 00:33:47 -0400 (Wed, 02 Apr 2008)
New Revision: 3862
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterServer.java
Log:
JBREM-934: Put MBeanServerFactory.createMBeanServer() call in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterServer.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterServer.java 2008-04-02 04:33:20 UTC (rev 3861)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/TransporterServer.java 2008-04-02 04:33:47 UTC (rev 3862)
@@ -30,6 +30,10 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
+
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -216,7 +220,21 @@
if (!services.isSetup())
{
// we need an MBeanServer to store our network registry and multicast detector services
- MBeanServer server = MBeanServerFactory.createMBeanServer();
+ MBeanServer server = null;
+ try
+ {
+ server = (MBeanServer) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return MBeanServerFactory.createMBeanServer();
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
// multicast detector will detect new network registries that come online
MulticastDetector detector = new MulticastDetector();
More information about the jboss-remoting-commits
mailing list