JBoss Remoting SVN: r5885 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2010-07-03 13:16:08 -0400 (Sat, 03 Jul 2010)
New Revision: 5885
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
Log:
JBREM-1231: Wrapped all state changing calls to InvokerRegistry in PrivilegedAction.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2010-07-03 16:11:42 UTC (rev 5884)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/InvokerLocator.java 2010-07-03 17:16:08 UTC (rev 5885)
@@ -867,8 +867,21 @@
* @throws Exception
*/
public ClientInvoker narrow() throws Exception
- {
- return InvokerRegistry.createClientInvoker(this);
+ {
+ try
+ {
+ return (ClientInvoker) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return InvokerRegistry.createClientInvoker(InvokerLocator.this);
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
}
14 years, 6 months
JBoss Remoting SVN: r5883 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2010-07-03 11:53:04 -0400 (Sat, 03 Jul 2010)
New Revision: 5883
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketInvokerClientTest.java
Log:
adding svn:eol-style native
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketInvokerClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketInvokerClientTest.java 2010-07-03 13:31:46 UTC (rev 5882)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketInvokerClientTest.java 2010-07-03 15:53:04 UTC (rev 5883)
@@ -1,56 +1,56 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.transport.bisocket;
-
-import org.jboss.test.remoting.transport.InvokerClientTest;
-
-/**
- * @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
- */
-public class BisocketInvokerClientTest extends InvokerClientTest
-{
- public String getTransport()
- {
- return "bisocket";
- }
-
- public static void main(String[] args)
- {
- BisocketInvokerClientTest client = new BisocketInvokerClientTest();
- try
- {
- client.setUp();
- client.testArrayReturn();
- client.testLocalPushCallback();
- client.testPullCallback();
- client.testPullCallback();
- client.testRemotePushCallback();
- client.testThrownException();
- client.tearDown();
- }
- catch (Throwable throwable)
- {
- throwable.printStackTrace();
- }
- }
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.remoting.transport.bisocket;
+
+import org.jboss.test.remoting.transport.InvokerClientTest;
+
+/**
+ * @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
+ */
+public class BisocketInvokerClientTest extends InvokerClientTest
+{
+ public String getTransport()
+ {
+ return "bisocket";
+ }
+
+ public static void main(String[] args)
+ {
+ BisocketInvokerClientTest client = new BisocketInvokerClientTest();
+ try
+ {
+ client.setUp();
+ client.testArrayReturn();
+ client.testLocalPushCallback();
+ client.testPullCallback();
+ client.testPullCallback();
+ client.testRemotePushCallback();
+ client.testThrownException();
+ client.tearDown();
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ }
+ }
}
\ No newline at end of file
Property changes on: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketInvokerClientTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
14 years, 6 months
JBoss Remoting SVN: r5882 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2010-07-03 09:31:46 -0400 (Sat, 03 Jul 2010)
New Revision: 5882
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ConnectionValidator.java
Log:
JBREM-1231: Wrapped all state changing calls to InvokerRegistry in PrivilegedAction.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ConnectionValidator.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ConnectionValidator.java 2010-07-03 13:29:11 UTC (rev 5881)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ConnectionValidator.java 2010-07-03 13:31:46 UTC (rev 5882)
@@ -22,6 +22,10 @@
package org.jboss.remoting;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -96,16 +100,29 @@
* @param config - any configuration needed for server
* @return true if alive, false if not
*/
- public static boolean checkConnection(InvokerLocator locator, Map config) throws Throwable
+ public static boolean checkConnection(final InvokerLocator locator, Map config) throws Throwable
{
boolean pingWorked = false;
- Map configMap = createPingConfig(config, null);
+ final Map configMap = createPingConfig(config, null);
int pingTimeout = Integer.parseInt((String) configMap.get(ServerInvoker.TIMEOUT));
ClientInvoker innerClientInvoker = null;
try
- {
- innerClientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);
+ {
+ try
+ {
+ innerClientInvoker = (ClientInvoker) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return InvokerRegistry.createClientInvoker(locator, configMap);
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
if (!innerClientInvoker.isConnected())
{
@@ -126,7 +143,14 @@
{
if (innerClientInvoker != null)
{
- InvokerRegistry.destroyClientInvoker(locator, configMap);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.destroyClientInvoker(locator, configMap);
+ return null;
+ }
+ });
}
}
@@ -737,7 +761,20 @@
try
{
- clientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);
+ try
+ {
+ clientInvoker = (ClientInvoker) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return InvokerRegistry.createClientInvoker(locator, configMap);
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
}
catch (Exception e)
{
@@ -849,7 +886,14 @@
if (clientInvoker != null)
{
- InvokerRegistry.destroyClientInvoker(locator, configMap);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.destroyClientInvoker(locator, configMap);
+ return null;
+ }
+ });
}
TimerUtil.unschedule(this);
14 years, 6 months
JBoss Remoting SVN: r5881 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2010-07-03 09:29:11 -0400 (Sat, 03 Jul 2010)
New Revision: 5881
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java
Log:
JBREM-1231: Wrapped all state changing calls to InvokerRegistry in PrivilegedAction.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java 2010-06-25 00:19:09 UTC (rev 5880)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Client.java 2010-07-03 13:29:11 UTC (rev 5881)
@@ -362,7 +362,20 @@
try
{
- this.invoker = InvokerRegistry.createClientInvoker(locator, configuration);
+ try
+ {
+ this.invoker = (ClientInvoker) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return InvokerRegistry.createClientInvoker(locator, configuration);
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
if(wasConnected)
{
connect();
@@ -629,7 +642,21 @@
configuration.put(Remoting.CUSTOM_SOCKET_FACTORY, socketFactory);
this.socketFactory = null;
}
- invoker = InvokerRegistry.createClientInvoker(locator, configuration);
+ try
+ {
+ invoker = (ClientInvoker) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return InvokerRegistry.createClientInvoker(locator, configuration);
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
+
}
connect(invoker, listener, metadata);
@@ -684,7 +711,14 @@
}
else
{
- InvokerRegistry.destroyClientInvoker(invoker.getLocator(), configuration);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.destroyClientInvoker(invoker.getLocator(), configuration);
+ return null;
+ }
+ });
}
invoker = null;
@@ -2064,7 +2098,23 @@
private void configureCallbackServerSocketFactory(Map map) throws Exception
{
- if (InvokerRegistry.isSSLSupported(locator.getProtocol()) &&
+ Boolean supportsSSL = null;
+ try
+ {
+ supportsSSL = (Boolean) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return new Boolean(InvokerRegistry.isSSLSupported(locator.getProtocol()));
+ }
+ });
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw pae.getException();
+ }
+
+ if (supportsSSL.booleanValue() &&
!map.containsKey(Remoting.CUSTOM_SERVER_SOCKET_FACTORY) &&
!map.containsKey(ServerInvoker.SERVER_SOCKET_FACTORY) &&
!map.containsKey(SSLSocketBuilder.REMOTING_SERVER_SOCKET_USE_CLIENT_MODE))
@@ -2087,7 +2137,14 @@
public void run()
{
log.debug(this + " calling InvokerRegistry.destroyClientInvoker() for " + invoker);
- InvokerRegistry.destroyClientInvoker(invoker.getLocator(), config);
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ InvokerRegistry.destroyClientInvoker(invoker.getLocator(), config);
+ return null;
+ }
+ });
synchronized (invokerDestructionTimerLock)
{
14 years, 6 months