JBoss Remoting SVN: r3725 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-21 13:09:43 -0400 (Fri, 21 Mar 2008)
New Revision: 3725
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java
Log:
Add linkedList method
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java 2008-03-21 06:06:32 UTC (rev 3724)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/CollectionUtil.java 2008-03-21 17:09:43 UTC (rev 3725)
@@ -13,6 +13,7 @@
import java.util.WeakHashMap;
import java.util.Collections;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
@@ -67,6 +68,15 @@
}
/**
+ * Create a linked list.
+ *
+ * @return a linked list
+ */
+ public static <T> LinkedList<T> linkedList() {
+ return new LinkedList<T>();
+ }
+
+ /**
* Create a synchronized array-backed list.
*
* @return a synchronized array-backed list
16 years, 9 months
JBoss Remoting SVN: r3724 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-21 02:06:32 -0400 (Fri, 21 Mar 2008)
New Revision: 3724
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
Log:
JBREM-934: In createControlConnection() fixed use of wrong host, port.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-03-21 05:36:27 UTC (rev 3723)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/bisocket/BisocketServerInvoker.java 2008-03-21 06:06:32 UTC (rev 3724)
@@ -376,8 +376,8 @@
Socket socket = null;
IOException savedException = null;
- final String finalHost = locator.getHost();
- final int finalPort = locator.getPort();
+ final String finalHost = host;
+ final int finalPort = port;
for (int i = 0; i < socketCreationRetries; i++)
{
16 years, 9 months
JBoss Remoting SVN: r3723 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-21 01:36:27 -0400 (Fri, 21 Mar 2008)
New Revision: 3723
Modified:
remoting2/branches/2.x/test.policy
Log:
More additions
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 05:23:33 UTC (rev 3722)
+++ remoting2/branches/2.x/test.policy 2008-03-21 05:36:27 UTC (rev 3723)
@@ -111,8 +111,14 @@
grant codeBase "file:${build.home}/output/tests/classes/-" {
// Used by the test suite itself
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
- permission javax.management.MBeanServerPermission "createMBeanServer";
+ permission javax.management.MBeanServerPermission "createMBeanServer, findMBeanServer";
permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:id=1,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.test.remoting.detection.metadata.MetadataTestCase$TestNetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.network.NetworkRegistry#-[remoting:type=NetworkRegistry]", "registerMBean, unregisterMBean, 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 java.lang.RuntimePermission "enableContextClassLoaderOverride";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
16 years, 9 months
JBoss Remoting SVN: r3722 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-21 01:23:33 -0400 (Fri, 21 Mar 2008)
New Revision: 3722
Modified:
remoting2/branches/2.x/test.policy
Log:
Typo in this description
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 05:21:34 UTC (rev 3721)
+++ remoting2/branches/2.x/test.policy 2008-03-21 05:23:33 UTC (rev 3722)
@@ -112,7 +112,7 @@
// Used by the test suite itself
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission javax.management.MBeanServerPermission "createMBeanServer";
- permission javax.management.MBeanPermission "org.jboss.remoting.transport.connector#-[jboss.remoting:id=1,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.Connector#-[jboss.remoting:id=1,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission java.lang.RuntimePermission "enableContextClassLoaderOverride";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
16 years, 9 months
JBoss Remoting SVN: r3721 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-21 01:21:34 -0400 (Fri, 21 Mar 2008)
New Revision: 3721
Modified:
remoting2/branches/2.x/test.policy
Log:
Missed a couple
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 05:21:33 UTC (rev 3720)
+++ remoting2/branches/2.x/test.policy 2008-03-21 05:21:34 UTC (rev 3721)
@@ -115,6 +115,8 @@
permission javax.management.MBeanPermission "org.jboss.remoting.transport.connector#-[jboss.remoting:id=1,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
permission java.lang.RuntimePermission "enableContextClassLoaderOverride";
permission java.lang.RuntimePermission "createClassLoader";
+ permission java.lang.RuntimePermission "getClassLoader";
+ permission java.lang.RuntimePermission "setContextClassLoader";
// This is technically the JNP server, but it seems intentional - note that this might mask other problems though
permission java.net.SocketPermission "*:*", "accept, connect, resolve";
16 years, 9 months
JBoss Remoting SVN: r3720 - 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-21 01:21:33 -0400 (Fri, 21 Mar 2008)
New Revision: 3720
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-934: Created final variable finalRegistry in initRMI.
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 05:19:35 UTC (rev 3719)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-21 05:21:33 UTC (rev 3720)
@@ -192,7 +192,7 @@
protected void initRMI(Home bindHome, Home connectHome) throws IOException
{
- final Registry registry = null;
+ Registry registry = null;
try
{
registry = getRegistry();
@@ -202,6 +202,7 @@
throw new IOException(e.getMessage());
}
+ final Registry finalRegistry = registry;
String bindHost = bindHome.host;
final int bindPort = bindHome.port;
String clientConnectHost = connectHome.host;
@@ -224,7 +225,7 @@
{
public Object run() throws AccessException, RemoteException
{
- registry.rebind("remoting/RMIServerInvoker/" + bindPort, RMIServerInvoker.this);
+ finalRegistry.rebind("remoting/RMIServerInvoker/" + bindPort, RMIServerInvoker.this);
return null;
}
});
16 years, 9 months
JBoss Remoting SVN: r3719 - remoting2/branches/2.x.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-21 01:19:35 -0400 (Fri, 21 Mar 2008)
New Revision: 3719
Modified:
remoting2/branches/2.x/build.xml
remoting2/branches/2.x/test.policy
Log:
Break out permissions for the test suite itself
Modified: remoting2/branches/2.x/build.xml
===================================================================
--- remoting2/branches/2.x/build.xml 2008-03-21 05:09:27 UTC (rev 3718)
+++ remoting2/branches/2.x/build.xml 2008-03-21 05:19:35 UTC (rev 3719)
@@ -31,8 +31,8 @@
<!-- set the security manager information for unit tests -->
<property name="java.security.policy" value="${basedir}/test.policy"/>
- <!--<property name="java.security.manager" value=""/>-->
- <property name="java.security.manager" value="org.jboss.test.security.LoggingSecurityManager"/>
+ <property name="java.security.manager" 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=""/>
Modified: remoting2/branches/2.x/test.policy
===================================================================
--- remoting2/branches/2.x/test.policy 2008-03-21 05:09:27 UTC (rev 3718)
+++ remoting2/branches/2.x/test.policy 2008-03-21 05:19:35 UTC (rev 3719)
@@ -97,6 +97,7 @@
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";
+ permission java.io.FilePermission "${build.home}/output/classes/-", "read";
};
grant codeBase "file:${build.home}/lib/-" {
@@ -108,7 +109,30 @@
};
grant codeBase "file:${build.home}/output/tests/classes/-" {
- permission java.security.AllPermission;
+ // Used by the test suite itself
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission javax.management.MBeanServerPermission "createMBeanServer";
+ permission javax.management.MBeanPermission "org.jboss.remoting.transport.connector#-[jboss.remoting:id=1,transport=socket,type=Connector]", "registerMBean, unregisterMBean, queryMBeans, isInstanceOf";
+ permission java.lang.RuntimePermission "enableContextClassLoaderOverride";
+ permission java.lang.RuntimePermission "createClassLoader";
+
+ // This is technically the JNP server, but it seems intentional - note that this might mask other problems though
+ permission java.net.SocketPermission "*:*", "accept, connect, resolve";
+
+ // TODO - this stuff ought to be in privileged blocks within the Ant JUnit task
+ permission java.util.PropertyPermission "*", "read, write"; // ugh
+
+ // TODO - JBoss Serialization SHOULD be doing these operations in a privileged block - JBSER-105
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
+ permission java.lang.RuntimePermission "reflectionFactoryAccess";
+ permission java.io.SerializablePermission "enableSubclassImplementation";
+ permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
+ permission java.io.SerializablePermission "enableSubstitution"; // <- this one is a "maybe" :-)
+
+ // TESTING ONLY - Use with the LoggingSecurityManager to locate needed permissions for the above block
+// permission java.security.AllPermission;
};
grant codeBase "file:${ant.library.dir}/-" {
16 years, 9 months
JBoss Remoting SVN: r3718 - 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-21 01:09:27 -0400 (Fri, 21 Mar 2008)
New Revision: 3718
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java
Log:
JBREM-934: Put Registry.lookup() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java 2008-03-21 05:04:18 UTC (rev 3717)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIClientInvoker.java 2008-03-21 05:09:27 UTC (rev 3718)
@@ -42,12 +42,14 @@
import org.jboss.remoting.marshal.rmi.RMIUnMarshaller;
import org.jboss.remoting.serialization.SerializationManager;
import org.jboss.remoting.serialization.SerializationStreamFactory;
+import org.jboss.util.propertyeditor.PropertyEditors;
import org.jboss.util.threadpool.BasicThreadPool;
import org.jboss.util.threadpool.BlockingMode;
import org.jboss.util.threadpool.RunnableTaskWrapper;
import org.jboss.util.threadpool.Task;
import org.jboss.util.threadpool.ThreadPool;
+import java.beans.IntrospectionException;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -58,6 +60,9 @@
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -223,13 +228,30 @@
{
home = (Home) it.next();
String host = home.host;
- int port = home.port;
+ final int port = home.port;
locator.setHomeInUse(home);
storeLocalConfig(configuration);
log.debug(this + " looking up registry: " + host + "," + port);
- Registry registry = LocateRegistry.getRegistry(host, registryPort);
+ final Registry registry = LocateRegistry.getRegistry(host, registryPort);
log.debug(this + " trying to connect to: " + home);
- Remote remoteObj = registry.lookup("remoting/RMIServerInvoker/" + port);
+ Remote remoteObj = null;
+
+ try
+ {
+ remoteObj = (Remote) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return registry.lookup("remoting/RMIServerInvoker/" + port);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ log.debug(e.toString(), e);
+ throw (Exception) e.getCause();
+ }
+
log.debug("Remote RMI Stub: " + remoteObj);
setServerStub((RMIServerInvokerInf) remoteObj);
connected = true;
16 years, 9 months
JBoss Remoting SVN: r3717 - remoting2/branches/2.x/src/main/org/jboss/remoting/loading.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-21 01:04:18 -0400 (Fri, 21 Mar 2008)
New Revision: 3717
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java
Log:
JBREM-934: Put Class.class.getDeclaredMethod() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java 2008-03-21 04:53:35 UTC (rev 3716)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java 2008-03-21 05:04:18 UTC (rev 3717)
@@ -22,13 +22,18 @@
package org.jboss.remoting.loading;
+import java.beans.IntrospectionException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.StreamCorruptedException;
import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import org.jboss.logging.Logger;
+import org.jboss.util.propertyeditor.PropertyEditors;
/**
@@ -40,25 +45,40 @@
*/
public class ObjectInputStreamWithClassLoader extends ObjectInputStream
{
-
+
protected static Method clearMethod;
-
+
protected static final Logger log = Logger.getLogger(ObjectInputStreamWithClassLoader.class);
-
-
-
+
+
+
static
{
- try {
- clearMethod = ObjectInputStream.class.getDeclaredMethod("clear", new Class[]{});
- clearMethod.setAccessible(true);
+ try
+ {
+ try {
+ clearMethod = (Method) AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws SecurityException, NoSuchMethodException
+ {
+ return ObjectInputStream.class.getDeclaredMethod("clear", new Class[]{});
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (NoSuchMethodException) e.getCause();
+ }
+
+ clearMethod.setAccessible(true);
+
} catch (SecurityException e) {
- log.error(e.getMessage(), e);
- } catch (NoSuchMethodException e) {
- log.error(e.getMessage(), e);
- }
+ log.error(e.getMessage(), e);
+ } catch (NoSuchMethodException e) {
+ log.error(e.getMessage(), e);
+ }
}
-
+
private ClassLoader cl;
// EJBTHREE-440
16 years, 9 months
JBoss Remoting SVN: r3716 - 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-21 00:53:35 -0400 (Fri, 21 Mar 2008)
New Revision: 3716
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-934: Put Registry.rebind() 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 04:41:03 UTC (rev 3715)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-21 04:53:35 UTC (rev 3716)
@@ -51,6 +51,7 @@
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.InetAddress;
+import java.rmi.AccessException;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
@@ -191,7 +192,7 @@
protected void initRMI(Home bindHome, Home connectHome) throws IOException
{
- Registry registry = null;
+ final Registry registry = null;
try
{
registry = getRegistry();
@@ -202,7 +203,7 @@
}
String bindHost = bindHome.host;
- int bindPort = bindHome.port;
+ final int bindPort = bindHome.port;
String clientConnectHost = connectHome.host;
if(clientConnectHost == null)
@@ -216,7 +217,23 @@
stub = UnicastRemoteObject.exportObject(this, bindPort, csf, ssf);
log.debug("Binding server to \"remoting/RMIServerInvoker/" + bindPort + "\" in registry");
- registry.rebind("remoting/RMIServerInvoker/" + bindPort, this);
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws AccessException, RemoteException
+ {
+ registry.rebind("remoting/RMIServerInvoker/" + bindPort, RMIServerInvoker.this);
+ return null;
+ }
+ });
+ }
+ catch (Exception e)
+ {
+ log.debug(e.toString(), e);
+ throw (IOException) e.getCause();
+ }
unmarshaller = MarshalFactory.getUnMarshaller(getLocator(), this.getClass().getClassLoader());
marshaller = MarshalFactory.getMarshaller(getLocator(), this.getClass().getClassLoader());
16 years, 9 months