[jboss-remoting-commits] JBoss Remoting SVN: r3868 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Apr 2 01:34:22 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-02 01:34:22 -0400 (Wed, 02 Apr 2008)
New Revision: 3868

Modified:
   remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java
Log:
JBREM-934: Put MBeanServerFactory.createMBeanServer() call in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java	2008-04-02 05:34:02 UTC (rev 3867)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java	2008-04-02 05:34:22 UTC (rev 3868)
@@ -22,6 +22,9 @@
 package org.jboss.test.remoting.ipv6;
 
 import java.net.InetAddress;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -112,7 +115,21 @@
    
    protected void doTest(String host) throws Throwable
    {
-      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();
+      }
 
       Connector connector = new Connector();
       port = PortUtil.findFreePort(host);




More information about the jboss-remoting-commits mailing list