Author: ron.sigal(a)jboss.com
Date: 2010-07-03 13:20:36 -0400 (Sat, 03 Jul 2010)
New Revision: 5889
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java
Log:
JBREM-1231: Wrapped all state changing calls to InvokerRegistry in PrivilegedAction.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java 2010-07-03
17:19:32 UTC (rev 5888)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/multiplex/MultiplexServerInvoker.java 2010-07-03
17:20:36 UTC (rev 5889)
@@ -30,6 +30,8 @@
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -490,13 +492,21 @@
protected void resetLocator(int bindPort)
{
this.bindPort = bindPort;
- InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(),
- locator.getHost(),
- bindPort,
- locator.getPath(),
- locator.getParameters());
+ final InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(),
+ locator.getHost(),
+ bindPort,
+ locator.getPath(),
+ locator.getParameters());
- InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
+ return null;
+ }
+ });
+
locator = newLocator;
}
@@ -918,9 +928,18 @@
}
// re-write locator since the port is different
- InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(),
locator.getHost(), bindPort, locator.getPath(), locator.getParameters());
+ final InvokerLocator newLocator = new InvokerLocator(locator.getProtocol(),
locator.getHost(), bindPort, locator.getPath(), locator.getParameters());
+
// need to update the locator key used in the invoker registry
- InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.updateServerInvokerLocator(locator, newLocator);
+ return null;
+ }
+ });
+
this.locator = newLocator;
}
Show replies by date