Author: ron.sigal(a)jboss.com
Date: 2008-04-11 21:44:49 -0400 (Fri, 11 Apr 2008)
New Revision: 3965
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/InternalTransporterServices.java
Log:
JBREM-934: Replaced AccessController.doPrivileged() call with
SecurityUtility.registerMBean() call.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/InternalTransporterServices.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/InternalTransporterServices.java 2008-04-12
01:43:43 UTC (rev 3964)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transporter/InternalTransporterServices.java 2008-04-12
01:44:49 UTC (rev 3965)
@@ -10,6 +10,7 @@
import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.remoting.detection.Detector;
import org.jboss.remoting.network.NetworkRegistry;
+import org.jboss.remoting.util.SecurityUtility;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -239,21 +240,7 @@
if (registerDetector)
{
- try
- {
- AccessController.doPrivileged( new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- m_mBeanServer.registerMBean(m_detector, m_detectorName);
- return null;
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw (Exception) e.getCause();
- }
+ SecurityUtility.registerMBean(m_mBeanServer, m_detector, m_detectorName);
}
}
@@ -311,22 +298,8 @@
m_networkRegistryName = registryName;
if (registerRegistry)
- {
- try
- {
- AccessController.doPrivileged( new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- m_mBeanServer.registerMBean(m_networkRegistry,
m_networkRegistryName);
- return null;
- }
- });
- }
- catch (PrivilegedActionException e)
- {
- throw (Exception) e.getCause();
- }
+ {
+ SecurityUtility.registerMBean(m_mBeanServer, m_networkRegistry,
m_networkRegistryName);
}
}
Show replies by date