JBoss Remoting SVN: r4188 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/multihome.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 14:33:55 -0400 (Tue, 13 May 2008)
New Revision: 4188
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/multihome/RMIMultihomeTestCase.java
Log:
JBREM-920: Reduced log level to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/multihome/RMIMultihomeTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/multihome/RMIMultihomeTestCase.java 2008-05-13 18:32:46 UTC (rev 4187)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/multihome/RMIMultihomeTestCase.java 2008-05-13 18:33:55 UTC (rev 4188)
@@ -48,7 +48,7 @@
if (firstTime)
{
firstTime = false;
- Logger.getLogger("org.jboss.remoting").setLevel(XLevel.TRACE);
+ Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
PatternLayout layout = new PatternLayout(pattern);
16 years, 6 months
JBoss Remoting SVN: r4187 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/keep_alive.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 14:32:46 -0400 (Tue, 13 May 2008)
New Revision: 4187
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/keep_alive/StressHTTPInvokerTestClient.java
Log:
JBREM-920: Reduced log statement to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/keep_alive/StressHTTPInvokerTestClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/keep_alive/StressHTTPInvokerTestClient.java 2008-05-13 18:27:52 UTC (rev 4186)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/keep_alive/StressHTTPInvokerTestClient.java 2008-05-13 18:32:46 UTC (rev 4187)
@@ -42,7 +42,7 @@
{
locatorURI = locatorURI + "&" + metadata;
}
- log.info("connecting to: " + locatorURI);
+ log.debug("connecting to: " + locatorURI);
return locatorURI;
}
16 years, 6 months
JBoss Remoting SVN: r4186 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/shutdown.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 14:27:52 -0400 (Tue, 13 May 2008)
New Revision: 4186
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/shutdown/log4j.xml
Log:
JBREM-920: Reduced log level to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/shutdown/log4j.xml
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/shutdown/log4j.xml 2008-05-13 18:25:42 UTC (rev 4185)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/shutdown/log4j.xml 2008-05-13 18:27:52 UTC (rev 4186)
@@ -77,12 +77,12 @@
<category name="org.jboss.remoting">
- <priority value="trace" class="org.jboss.logging.XLevel"/>
+ <priority value="INFO" class="org.jboss.logging.XLevel"/>
</category>
<category name="org.jboss.test.remoting">
- <priority value="trace" class="org.jboss.logging.XLevel"/>
+ <priority value="INFO" class="org.jboss.logging.XLevel"/>
</category>
16 years, 6 months
JBoss Remoting SVN: r4185 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/connectionfailure.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 14:25:42 -0400 (Tue, 13 May 2008)
New Revision: 4185
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/connectionfailure/CallbackConnectionFailureTestParent.java
Log:
JBREM-920: Reduced log level to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/connectionfailure/CallbackConnectionFailureTestParent.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/connectionfailure/CallbackConnectionFailureTestParent.java 2008-05-13 18:24:36 UTC (rev 4184)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/connectionfailure/CallbackConnectionFailureTestParent.java 2008-05-13 18:25:42 UTC (rev 4185)
@@ -83,7 +83,7 @@
if (firstTime)
{
firstTime = false;
- Logger.getLogger("org.jboss.remoting").setLevel(XLevel.TRACE);
+ Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
PatternLayout layout = new PatternLayout(pattern);
16 years, 6 months
JBoss Remoting SVN: r4184 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/exception.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 14:24:36 -0400 (Tue, 13 May 2008)
New Revision: 4184
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/exception/CallbackTestCase.java
Log:
JBREM-920: Reduced log level to INFO.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/exception/CallbackTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/exception/CallbackTestCase.java 2008-05-13 05:29:41 UTC (rev 4183)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/callback/exception/CallbackTestCase.java 2008-05-13 18:24:36 UTC (rev 4184)
@@ -44,7 +44,7 @@
protected Level getTestLogLevel()
{
- return Level.DEBUG;
+ return Level.INFO;
}
/**
16 years, 6 months
JBoss Remoting SVN: r4183 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 01:29:41 -0400 (Tue, 13 May 2008)
New Revision: 4183
Modified:
remoting2/branches/2.x/build.xml
Log:
JBREM-920: Unit test suite defaults to running with security manager; JBREM-978: changed HTTP test for security test suite.
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-05-13 05:12:06 UTC (rev 4182)
+++ remoting2/branches/2.x/build.xml 2008-05-13 05:29:41 UTC (rev 4183)
@@ -350,22 +350,17 @@
<property name="perf.seq.dojava" value="yes"/>
<property name="perf.seq.dojboss" value="yes"/>
- <!-- set the security manager information for unit tests -->
+ <property name="enable.security.manager" value="yes"/>
<condition property="java.security.manager.key" value="java.security.manager">
- <isset property="isJDK6"/>
+ <equals arg1="yes" arg2="${enable.security.manager}"/>
</condition>
-
- <condition property="java.security.manager.key" value="no.java.security.manager">
- <or>
- <isset property="isJDK4"/>
- <isset property="isJDK5"/>
- </or>
+ <condition property="java.security.manager.key" value="dummy">
+ <not><equals arg1="yes" arg2="${enable.security.manager}"/></not>
</condition>
-
+ <property name="java.security.manager" value=""/>
<property name="java.security.policy" value="${etc.dir}/remoting.security.policy"/>
<property name="java.security.policy.marshal" value="${etc.dir}/remoting.security.policy.marshal"/>
<property name="java.security.policy.strict" value="${etc.dir}/remoting.security.policy.strict"/>
- <property name="${java.security.manager.key}" value=""/>
<!--<property name="java.security.manager" value="org.jboss.test.security.LoggingSecurityManager"/>-->
<!--<property name="java.security.debug" value="access,failure"/>-->
<property name="java.security.debug" value=""/>
@@ -1336,7 +1331,7 @@
<batchtest fork="yes" todir="${output.tests.results}"
haltonfailure="no">
<fileset dir="${tests.compile.dir}">
- <include name="**/remoting/transport/http/HTTPInvokerTestCase.class"/>
+ <include name="**/remoting/transport/http/HTTPInvokerSecurityTestCase.class"/>
<include name="**/remoting/transport/http/ssl/custom/HTTPSInvokerTestCase.class"/>
</fileset>
</batchtest>
16 years, 6 months
JBoss Remoting SVN: r4182 - remoting2/branches/2.x/src/etc.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 01:12:06 -0400 (Tue, 13 May 2008)
New Revision: 4182
Modified:
remoting2/branches/2.x/src/etc/remoting.security.policy.tests.minimal
Log:
JBREM-978: Removed SocketPermissions.
Modified: remoting2/branches/2.x/src/etc/remoting.security.policy.tests.minimal
===================================================================
--- remoting2/branches/2.x/src/etc/remoting.security.policy.tests.minimal 2008-05-13 05:04:19 UTC (rev 4181)
+++ remoting2/branches/2.x/src/etc/remoting.security.policy.tests.minimal 2008-05-13 05:12:06 UTC (rev 4182)
@@ -67,15 +67,12 @@
permission java.util.PropertyPermission "org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "read";
permission java.util.PropertyPermission "jrunit.bind_addr", "read";
-
- permission java.net.SocketPermission "*:*", "accept,resolve";
// org.jboss.test.remoting.transport.InvokerTestDriver
permission java.util.PropertyPermission "remoting.metadata", "read";
permission java.util.PropertyPermission "jvm.mx", "read";
// org.jboss.test.taskdefs.XMLJUnitMultipleResultFormatter
- permission java.net.SocketPermission "*:*", "connect";
permission java.util.PropertyPermission "jboss-junit-configuration", "read";
// org.jboss.test.remoting.transport.InvokerClientTest
16 years, 6 months
JBoss Remoting SVN: r4181 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 01:04:19 -0400 (Tue, 13 May 2008)
New Revision: 4181
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityClientTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityServerTest.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityTestCase.java
Log:
JBREM-978: New unit test for http security suite.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityClientTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityClientTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityClientTest.java 2008-05-13 05:04:19 UTC (rev 4181)
@@ -0,0 +1,40 @@
+/*
+* 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.http;
+
+import org.jboss.test.remoting.transport.InvokerClientTest;
+
+/**
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 12, 2008
+ * </p>
+ */
+public class HTTPInvokerSecurityClientTest extends InvokerClientTest
+{
+ public String getTransport()
+ {
+ return "http";
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityServerTest.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityServerTest.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityServerTest.java 2008-05-13 05:04:19 UTC (rev 4181)
@@ -0,0 +1,65 @@
+/*
+* 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.http;
+
+import org.apache.log4j.Level;
+import org.jboss.test.remoting.transport.InvokerServerTest;
+
+/**
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 12, 2008
+ * </p>
+ */
+public class HTTPInvokerSecurityServerTest extends InvokerServerTest
+{
+ public String getTransport()
+ {
+ return "http";
+ }
+
+ public static void main(String[] args)
+ {
+ org.apache.log4j.BasicConfigurator.configure();
+ org.apache.log4j.Category.getRoot().setLevel(Level.INFO);
+ org.apache.log4j.Category.getInstance("org.jboss.remoting.transport.socket").setLevel(Level.DEBUG);
+ org.apache.log4j.Category.getInstance("org.jboss.test.remoting").setLevel(Level.DEBUG);
+ org.apache.log4j.Category.getInstance("org.jgroups").setLevel(Level.FATAL);
+
+ InvokerServerTest server = new HTTPInvokerSecurityServerTest();
+ try
+ {
+ server.setUp();
+ Thread.sleep(300000);
+ server.tearDown();
+ System.out.println("Have torn down test.");
+ Thread.sleep(30000);
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/http/HTTPInvokerSecurityTestCase.java 2008-05-13 05:04:19 UTC (rev 4181)
@@ -0,0 +1,83 @@
+/*
+* 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.http;
+
+import org.apache.log4j.Level;
+import org.jboss.test.remoting.transport.InvokerTestDriver;
+
+/**
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 12, 2008
+ * </p>
+ */
+public class HTTPInvokerSecurityTestCase extends InvokerTestDriver
+{
+ public void declareTestClasses()
+ {
+ addTestClasses(HTTPInvokerSecurityClientTest.class.getName(),
+ 1,
+ HTTPInvokerSecurityServerTest.class.getName());
+ }
+
+ protected Level getTestLogLevel()
+ {
+ return Level.INFO;
+ }
+
+ /**
+ * How long to wait for test results to be returned from the client(s). If goes longer than the
+ * specified limit, will throw an exception and kill the running test cases. Default value is
+ * RESULTS_TIMEOUT.
+ *
+ * @return
+ */
+ protected long getResultsTimeout()
+ {
+ return 600000;
+ }
+
+ /**
+ * How long for the server test case to wait for tear down message. If exceeds timeout,
+ * will throw exception. The default value is TEARDOWN_TIMEOUT.
+ *
+ * @return
+ */
+ protected long getTearDownTimeout()
+ {
+ return 60000;
+ }
+
+ /**
+ * How long to allow each of the test cases to run their tests. If exceeds this timeout
+ * will throw exception and kill tests. The default value is RUN_TEST_TIMEOUT.
+ *
+ * @return
+ */
+ protected long getRunTestTimeout()
+ {
+ return 60000;
+ }
+
+}
\ No newline at end of file
16 years, 6 months
JBoss Remoting SVN: r4180 - remoting2/branches/2.x/src/main/org/jboss/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 00:55:52 -0400 (Tue, 13 May 2008)
New Revision: 4180
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java
Log:
JBREM-978: Added several new methods, many of them related to RMI.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java 2008-05-13 04:54:55 UTC (rev 4179)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/util/SecurityUtility.java 2008-05-13 04:55:52 UTC (rev 4180)
@@ -28,13 +28,24 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.OutputStream;
import java.lang.reflect.Method;
+import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;
import java.net.UnknownHostException;
+import java.rmi.AccessException;
+import java.rmi.NotBoundException;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.RMIClientSocketFactory;
+import java.rmi.server.RMIServerSocketFactory;
+import java.rmi.server.UnicastRemoteObject;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -49,6 +60,9 @@
import org.jboss.remoting.Remoting;
import org.jboss.remoting.security.ServerSocketFactoryMBean;
+import org.jboss.remoting.transport.rmi.RMIServerInvoker;
+import org.jboss.remoting.transport.rmi.RMIServerInvokerInf;
+import org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory;
import org.jboss.serial.io.JBossObjectInputStream;
import org.jboss.serial.io.JBossObjectOutputStream;
@@ -693,7 +707,9 @@
{
if (skipAccessControl)
{
- return c.getDeclaredMethod(name, parameterTypes);
+ Method m = c.getDeclaredMethod(name, parameterTypes);
+ m.setAccessible(true);
+ return m;
}
try
@@ -702,7 +718,9 @@
{
public Object run() throws NoSuchMethodException
{
- return c.getDeclaredMethod(name, parameterTypes);
+ Method m = c.getDeclaredMethod(name, parameterTypes);
+ m.setAccessible(true);
+ return m;
}
});
}
@@ -854,6 +872,32 @@
}
+ static public void connect(final HttpURLConnection conn) throws IOException
+ {
+ if (skipAccessControl)
+ {
+ conn.connect();
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ conn.connect();
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+
static public ServerSocket createServerSocket(final ServerSocketFactoryMBean ssf) throws IOException
{
if (skipAccessControl)
@@ -1276,4 +1320,244 @@
throw (UnknownHostException) e.getCause();
}
}
+
+
+ static public OutputStream getOutputStream(final HttpURLConnection conn)
+ throws IOException
+ {
+ if (skipAccessControl)
+ {
+ return conn.getOutputStream();
+ }
+
+ try
+ {
+ return (OutputStream)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ return conn.getOutputStream();
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+
+ static public int getResponseCode(final HttpURLConnection conn)
+ throws IOException
+ {
+ if (skipAccessControl)
+ {
+ return conn.getResponseCode();
+ }
+
+ try
+ {
+ return ((Integer) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ return new Integer(conn.getResponseCode());
+ }
+ })).intValue();
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+
+ static public Object callTransport(final RMIServerInvokerInf server, final Object payload)
+ throws IOException
+ {
+ if (skipAccessControl)
+ {
+ return server.transport(payload);
+ }
+
+ try
+ {
+ return AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ return server.transport(payload);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+
+ static public Registry createRegistry(final int port) throws RemoteException
+ {
+ if (skipAccessControl)
+ {
+ return LocateRegistry.createRegistry(port);
+ }
+
+ try
+ {
+ return (Registry) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws RemoteException
+ {
+ return LocateRegistry.createRegistry(port);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (RemoteException) e.getCause();
+ }
+ }
+
+
+ static public Remote exportObject(final Remote object,
+ final int port,
+ final RMIClientSocketFactory csf,
+ final RMIServerSocketFactory ssf)
+ throws RemoteException
+ {
+ if (skipAccessControl)
+ {
+ return UnicastRemoteObject.exportObject(object, port, csf, ssf);
+ }
+
+ try
+ {
+ return (Remote) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws RemoteException
+ {
+ return UnicastRemoteObject.exportObject(object, port, csf, ssf);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (RemoteException) e.getCause();
+ }
+ }
+
+
+ static public Registry getRegistry(final int port) throws RemoteException
+ {
+ if (skipAccessControl)
+ {
+ return LocateRegistry.getRegistry(port);
+ }
+
+ try
+ {
+ return (Registry) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws RemoteException
+ {
+ return LocateRegistry.getRegistry(port);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (RemoteException) e.getCause();
+ }
+ }
+
+
+ static public Remote lookup(final Registry registry, final String name)
+ throws RemoteException, NotBoundException
+ {
+ if (skipAccessControl)
+ {
+ return registry.lookup(name);
+ }
+
+ try
+ {
+ return (Remote) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return registry.lookup(name);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause instanceof RemoteException)
+ throw (RemoteException) cause;
+ else
+ throw (NotBoundException) cause;
+ }
+ }
+
+
+ static public void rebind(final Registry registry, final String name, final Remote object)
+ throws IOException
+ {
+ if (skipAccessControl)
+ {
+ registry.rebind(name, object);
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ registry.rebind(name, object);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+
+ static public void unbind(final Registry registry, final String name)
+ throws AccessException, RemoteException, NotBoundException
+ {
+ if (skipAccessControl)
+ {
+ registry.unbind(name);
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws AccessException, RemoteException, NotBoundException
+ {
+ registry.unbind(name);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause instanceof AccessException)
+ throw (AccessException) cause;
+ else if (cause instanceof RemoteException)
+ throw (RemoteException) cause;
+ else
+ throw (NotBoundException) cause;
+ }
+ }
}
\ No newline at end of file
16 years, 6 months
JBoss Remoting SVN: r4179 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-13 00:54:55 -0400 (Tue, 13 May 2008)
New Revision: 4179
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketClientInvoker.java
Log:
JBREM-978: Moved Socket.connect() to SecurityUtility.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketClientInvoker.java 2008-05-13 04:54:35 UTC (rev 4178)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketClientInvoker.java 2008-05-13 04:54:55 UTC (rev 4179)
@@ -28,6 +28,7 @@
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.socketfactory.SocketFactoryWrapper;
import org.jboss.remoting.transport.socket.SocketClientInvoker;
+import org.jboss.remoting.util.SecurityUtility;
import org.jboss.remoting.util.socket.HandshakeRepeater;
import javax.net.SocketFactory;
@@ -179,7 +180,7 @@
timeout = 0;
}
- s.connect(inetAddr, timeout);
+ SecurityUtility.connect(s, inetAddr, timeout);
if (s instanceof SSLSocket)
{
16 years, 6 months