JBoss Remoting SVN: r3715 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-21 00:41:03 -0400 (Fri, 21 Mar 2008)
New Revision: 3715
Modified:
remoting2/branches/2.x/build.xml
Log:
JBREM-923: Replaced multiplex with bisocket.
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-03-21 03:01:24 UTC (rev 3714)
+++ remoting2/branches/2.x/build.xml 2008-03-21 04:41:03 UTC (rev 3715)
@@ -1005,8 +1005,6 @@
haltonfailure="no">
<fileset dir="${tests.compile.dir}">
<include name="**/remoting/**/*TestCase.class"/>
- <!-- DML - these are reeeeeaaaalllyyyy slooooooooooowwww on linux -->
- <!--<exclude name="**/remoting/**/marshall/compress/**/*TestCase.class"/>-->
<exclude name="**/remoting/**/http/**/*TestCase.class"/>
<exclude name="**/remoting/**/*HTTP*TestCase.class"/>
<exclude name="**/remoting/**/*Http*TestCase.class"/>
@@ -2218,8 +2216,8 @@
<param name="metadata" value="serializationtype=java"/>
<param name="serialization" value="java"/>
</antcall>
- <antcall target="tests.performance.multiplex" inheritrefs="true">
- <param name="remoting.metadata.key" value="remoting.metadata.callback"/>
+ <antcall target="tests.performance.bisocket" inheritrefs="true">
+ <param name="remoting.metadata.key" value="remoting.metadata"/>
<param name="metadata" value="serializationtype=java"/>
<param name="serialization" value="java"/>
</antcall>
@@ -2262,8 +2260,8 @@
<param name="metadata" value="serializationtype=jboss"/>
<param name="serialization" value="jboss"/>
</antcall>
- <antcall target="tests.performance.multiplex" inheritrefs="true">
- <param name="remoting.metadata.key" value="remoting.metadata.callback"/>
+ <antcall target="tests.performance.bisocket" inheritrefs="true">
+ <param name="remoting.metadata.key" value="remoting.metadata"/>
<param name="metadata" value="serializationtype=jboss"/>
<param name="serialization" value="jboss"/>
</antcall>
@@ -2548,6 +2546,23 @@
<param name="jboss-junit-configuration" value="socket_100000_3_2048_${serialization}"/>
</antcall>
</target>
+
+ <target name="tests.performance.bisocket">
+ <antcall target="tests.performance.run" inheritrefs="true">
+ <param name="transport" value="bisocket"/>
+ <param name="numofcalls" value="100000"/>
+ <param name="numofclients" value="1"/>
+ <param name="payloadsize" value="1024"/>
+ <param name="jboss-junit-configuration" value="bisocket_100000_1_1024_${serialization}"/>
+ </antcall>
+ <antcall target="tests.performance.run" inheritrefs="true">
+ <param name="transport" value="bisocket"/>
+ <param name="numofcalls" value="100000"/>
+ <param name="numofclients" value="3"/>
+ <param name="payloadsize" value="2048"/>
+ <param name="jboss-junit-configuration" value="bisocket_100000_3_2048_${serialization}"/>
+ </antcall>
+ </target>
<target name="tests.performance.http">
<antcall target="tests.performance.run" inheritrefs="true">
@@ -2701,6 +2716,12 @@
<path refid="tests.classpath"/>
<pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
+ <sysproperty key="jrunit.bind_addr" value="${bind.address}"/>
+ <sysproperty key="jrunit.mcast_addr" value="${multicast.address}"/>
+ <sysproperty key="jrunit.mcast_port" value="${multicast.port}"/>
+ <sysproperty key="jrunit.receive_on_all_interfaces" value="${receiveOnAllInterfaces}"/>
+ <sysproperty key="jrunit.send_on_all_interfaces" value="${sendOnAllInterfaces}"/>
+ <sysproperty key="jrunit.send_interfaces" value="${sendInterfaces}"/>
<sysproperty key="jboss-junit-configuration" value="${jboss-junit-configuration}"/>
<formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
extension="-${jboss-junit-configuration}.xml"/>
16 years, 9 months
JBoss Remoting SVN: r3714 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 23:01:24 -0400 (Thu, 20 Mar 2008)
New Revision: 3714
Modified:
remoting2/branches/2.x/test.policy
Log:
Remove the now-redundant usage of the test jars from the policy
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 02:59:13 UTC (rev 3713)
+++ remoting2/branches/2.x/test.policy 2008-03-21 03:01:24 UTC (rev 3714)
@@ -111,14 +111,6 @@
permission java.security.AllPermission;
};
-grant codeBase "file:${build.home}/output/lib/jboss-remoting-tests.jar" {
- permission java.security.AllPermission;
-};
-
-grant codeBase "file:${build.home}/output/lib/jboss-remoting-loading-tests.jar" {
- permission java.security.AllPermission;
-};
-
grant codeBase "file:${ant.library.dir}/-" {
permission java.security.AllPermission;
};
16 years, 9 months
JBoss Remoting SVN: r3713 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 22:59:13 -0400 (Thu, 20 Mar 2008)
New Revision: 3713
Modified:
remoting2/branches/2.x/build.xml
Log:
On tests that use the security manager, remove the redundant jboss-remoting-tests.jar from the classpath to simplify security policy config
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-03-21 02:32:10 UTC (rev 3712)
+++ remoting2/branches/2.x/build.xml 2008-03-21 02:59:13 UTC (rev 3713)
@@ -936,7 +936,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="tests.classpath"/>
- <!--<pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>-->
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -987,7 +986,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1007,6 +1005,8 @@
haltonfailure="no">
<fileset dir="${tests.compile.dir}">
<include name="**/remoting/**/*TestCase.class"/>
+ <!-- DML - these are reeeeeaaaalllyyyy slooooooooooowwww on linux -->
+ <!--<exclude name="**/remoting/**/marshall/compress/**/*TestCase.class"/>-->
<exclude name="**/remoting/**/http/**/*TestCase.class"/>
<exclude name="**/remoting/**/*HTTP*TestCase.class"/>
<exclude name="**/remoting/**/*Http*TestCase.class"/>
@@ -1044,7 +1044,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1076,7 +1075,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1113,7 +1111,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="${classpath}"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1158,7 +1155,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="${classpath}"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1209,7 +1205,6 @@
<jvmarg value="-D${remoting.metadata.key}=${metadata}"/>
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1240,7 +1235,6 @@
<junit printsummary="true" fork="yes" includeantruntime="true" tempdir="${output.tests.tmp}">
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
@@ -1306,7 +1300,6 @@
<classpath>
<path refid="tests.classpath"/>
- <pathelement location="${output.lib.dir}/jboss-remoting-tests.jar"/>
</classpath>
<sysproperty key="java.security.manager" value="${java.security.manager}"/>
<sysproperty key="java.security.policy" value="${java.security.policy}"/>
16 years, 9 months
JBoss Remoting SVN: r3712 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 22:32:10 -0400 (Thu, 20 Mar 2008)
New Revision: 3712
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920 - SSLSocketBuilderTestCase and OnewayThreadPoolTestCase turned these up
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 01:52:28 UTC (rev 3711)
+++ remoting2/branches/2.x/test.policy 2008-03-21 02:32:10 UTC (rev 3712)
@@ -53,7 +53,14 @@
permission java.util.PropertyPermission "jboss.remoting.instanceid", "write";
permission java.util.PropertyPermission "jboss.remoting.domain", "write";
permission java.util.PropertyPermission "SERIALIZATION", "read";
+ permission java.util.PropertyPermission "http.basic.username", "read";
+ permission java.util.PropertyPermission "org.jboss.remoting.defaultSocketFactory", "read";
+ // Tomcat native - TODO - this should be in a privileged block in jbossnative
+ permission java.lang.RuntimePermission "loadLibrary.tcnative-1";
+ permission java.lang.RuntimePermission "loadLibrary.libtcnative-1";
+ permission java.util.PropertyPermission "java.library.path", "read";
+
// Permission to read the test keystore
permission java.io.FilePermission "${build.home}/output/tests/classes/-", "read";
permission java.io.FilePermission "${build.home}", "read";
@@ -87,6 +94,9 @@
permission java.util.PropertyPermission "log4j.configDebug", "read";
permission java.util.PropertyPermission "log4j.debug", "read";
permission java.util.PropertyPermission "log4j.configuration", "read";
+ permission java.util.PropertyPermission "org.apache.commons.logging.LogFactory", "read";
+ permission java.util.PropertyPermission "org.apache.commons.logging.Log", "read";
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
};
grant codeBase "file:${build.home}/lib/-" {
16 years, 9 months
JBoss Remoting SVN: r3711 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-20 21:52:28 -0400 (Thu, 20 Mar 2008)
New Revision: 3711
Modified:
remoting2/branches/2.x/test.policy
Log:
JBREM-920 - One more MBean thinger.
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 01:41:22 UTC (rev 3710)
+++ remoting2/branches/2.x/test.policy 2008-03-21 01:52:28 UTC (rev 3711)
@@ -27,6 +27,7 @@
permission javax.management.MBeanPermission "javax.management.MBeanServerDelegate#-[JMImplementation:type=MBeanServerDelegate]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=JNDIDetector]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MulticastDetector]", "queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.detection.multicast.MulticastDetector#-[remoting:type=MultiplexDetector]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "queryMBeans, isInstanceOf";
permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#Servers[remoting:type=NetworkRegistry]", "getAttribute";
16 years, 9 months
JBoss Remoting SVN: r3710 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:41:22 -0400 (Thu, 20 Mar 2008)
New Revision: 3710
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
Log:
JBREM-934: Put PropertyEditors.mapJavaBeanProperties(), ServerSocket.accept() and ServerSocket.bind() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-03-21 01:40:16 UTC (rev 3709)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketServerInvoker.java 2008-03-21 01:41:22 UTC (rev 3710)
@@ -26,18 +26,25 @@
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvoker;
import org.jboss.remoting.util.TimerUtil;
+import org.jboss.remoting.loading.ClassByteClassLoader;
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.util.propertyeditor.PropertyEditors;
import org.jboss.logging.Logger;
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLException;
+
+import java.beans.IntrospectionException;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -175,7 +182,22 @@
protected void setup() throws Exception
{
props.putAll(getConfiguration());
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IntrospectionException
+ {
+ PropertyEditors.mapJavaBeanProperties(this, props, false);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug(e.toString(), e);
+ throw e;
+ }
super.setup();
@@ -268,7 +290,7 @@
}
protected ServerSocket createServerSocket(int serverBindPort,
- int backlog,
+ final int backlog,
InetAddress bindAddress) throws IOException
{
ServerSocketFactory factory = getServerSocketFactory();
@@ -290,8 +312,26 @@
ss.setReuseAddress(getReuseAddress());
configureServerSocket(ss);
- InetSocketAddress address = new InetSocketAddress(bindAddress, serverBindPort);
- ss.bind(address, backlog);
+ final InetSocketAddress address = new InetSocketAddress(bindAddress, serverBindPort);
+ final ServerSocket finalServerSocket = ss;
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ finalServerSocket.bind(address, backlog);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+
+
return ss;
}
@@ -974,7 +1014,21 @@
if(trace) { log.trace(this + " is going to wait on serverSocket.accept()"); }
- Socket socket = serverSocket.accept();
+ Socket socket = null;
+ try
+ {
+ socket = (Socket)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return serverSocket.accept();
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
if(trace) { log.trace(this + " accepted " + socket); }
16 years, 9 months
JBoss Remoting SVN: r3709 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:40:16 -0400 (Thu, 20 Mar 2008)
New Revision: 3709
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketClientInvoker.java
Log:
JBREM-934: Put Socket.connect() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketClientInvoker.java 2008-03-21 01:39:44 UTC (rev 3708)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/SocketClientInvoker.java 2008-03-21 01:40:16 UTC (rev 3709)
@@ -36,6 +36,9 @@
import java.net.SocketTimeoutException;
import java.net.InetSocketAddress;
import java.rmi.MarshalException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Map;
/**
@@ -185,7 +188,7 @@
}
configureSocket(s);
- InetSocketAddress inetAddr = new InetSocketAddress(address, port);
+ final InetSocketAddress inetAddr = new InetSocketAddress(address, port);
if (timeout < 0)
{
@@ -194,7 +197,24 @@
timeout = 0;
}
- s.connect(inetAddr, timeout);
+ final Socket finalSocket = s;
+ final int finalTimeout = timeout;
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ finalSocket.connect(inetAddr, finalTimeout);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
return s;
}
16 years, 9 months
JBoss Remoting SVN: r3708 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:39:44 -0400 (Thu, 20 Mar 2008)
New Revision: 3708
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-934: Put PropertyEditors.mapJavaBeanProperties() and Socket.connect() in AccessController.doPrivileged() calls.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-21 01:38:23 UTC (rev 3707)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-21 01:39:44 UTC (rev 3708)
@@ -19,6 +19,7 @@
import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
import org.jboss.util.propertyeditor.PropertyEditors;
+import java.beans.IntrospectionException;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
@@ -28,6 +29,9 @@
import java.net.Socket;
import java.net.InetSocketAddress;
import java.net.SocketException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -477,9 +481,26 @@
protected void setup() throws Exception
{
- Properties props = new Properties();
+ final Properties props = new Properties();
props.putAll(configuration);
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IntrospectionException
+ {
+ PropertyEditors.mapJavaBeanProperties(this, props, false);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug(e.toString(), e);
+ throw e;
+ }
+
configureParameters();
if (!InvokerLocator.MULTIHOME.equals(locator.getHost()))
@@ -1099,10 +1120,26 @@
protected Socket createSocket(String address, int port, int timeout) throws IOException
{
- Socket s = new Socket();
+ final Socket s = new Socket();
configureSocket(s);
- InetSocketAddress inetAddr = new InetSocketAddress(address, port);
- s.connect(inetAddr);
+ final InetSocketAddress inetAddr = new InetSocketAddress(address, port);
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ s.connect(inetAddr);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+
return s;
}
16 years, 9 months
JBoss Remoting SVN: r3707 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:38:23 -0400 (Thu, 20 Mar 2008)
New Revision: 3707
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-934: Put PropertyEditors.mapJavaBeanProperties() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-21 01:37:50 UTC (rev 3706)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-21 01:38:23 UTC (rev 3707)
@@ -44,6 +44,7 @@
import javax.net.SocketFactory;
+import java.beans.IntrospectionException;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -60,6 +61,9 @@
import java.rmi.server.RemoteServer;
import java.rmi.server.ServerNotActiveException;
import java.rmi.server.UnicastRemoteObject;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -141,9 +145,26 @@
protected void setup() throws Exception
{
- Properties props = new Properties();
+ final Properties props = new Properties();
props.putAll(getConfiguration());
- PropertyEditors.mapJavaBeanProperties(this, props, false);
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IntrospectionException
+ {
+ PropertyEditors.mapJavaBeanProperties(this, props, false);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug(e.toString(), e);
+ throw e;
+ }
+
super.setup();
}
16 years, 9 months
JBoss Remoting SVN: r3706 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:37:50 -0400 (Thu, 20 Mar 2008)
New Revision: 3706
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIServerSocketFactory.java
Log:
JBREM-934: Put ServerSocket creation in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIServerSocketFactory.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIServerSocketFactory.java 2008-03-21 01:37:02 UTC (rev 3705)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIServerSocketFactory.java 2008-03-21 01:37:50 UTC (rev 3706)
@@ -23,6 +23,7 @@
package org.jboss.remoting.transport.rmi;
import org.jboss.logging.Logger;
+import org.jboss.remoting.loading.ClassByteClassLoader;
import javax.net.ServerSocketFactory;
import java.io.IOException;
@@ -31,6 +32,9 @@
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.rmi.server.RMIServerSocketFactory;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
/**
@@ -144,33 +148,49 @@
* @return a new <code>ServerSocket</code>
* @throws IOException if there is a problem creating a server socket
*/
- public ServerSocket createServerSocket(int port) throws IOException
+ public ServerSocket createServerSocket(final int port) throws IOException
{
ServerSocket svrSocket = null;
- if(serverSocketFactory != null)
+ try
{
- svrSocket = serverSocketFactory.createServerSocket(port, backlog, bindAddress);
- }
+ svrSocket = (ServerSocket)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ ServerSocket ss = null;
-// if (constructor != null)
-// {
-// try
-// {
-// if (portPosition != -1)
-// args[portPosition] = new Integer(port);
-//
-// return (ServerSocket) constructor.newInstance(args);
-// }
-// catch (Exception e)
-// {
-// throw new IOException(e.getMessage());
-// }
-// }
+ if(serverSocketFactory != null)
+ {
+ ss = serverSocketFactory.createServerSocket(port, backlog, bindAddress);
+ }
- else
+// if (constructor != null)
+// {
+// try
+// {
+// if (portPosition != -1)
+// args[portPosition] = new Integer(port);
+ //
+// return (ServerSocket) constructor.newInstance(args);
+// }
+// catch (Exception e)
+// {
+// throw new IOException(e.getMessage());
+// }
+// }
+
+ else
+ {
+ ss = new ServerSocket(port, backlog, bindAddress);
+ }
+ return ss;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
{
- svrSocket = new ServerSocket(port, backlog, bindAddress);
+ throw (IOException) e.getCause();
}
svrSocket.setSoTimeout(timeout);
16 years, 9 months