JBoss Remoting SVN: r4128 - remoting2/branches/2.x/src/main/org/jboss/remoting/detection.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 19:31:36 -0400 (Wed, 07 May 2008)
New Revision: 4128
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java
Log:
JBREM-977: Wraps NetworkRegistry proxies.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java 2008-05-07 23:30:30 UTC (rev 4127)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/detection/AbstractDetector.java 2008-05-07 23:31:36 UTC (rev 4128)
@@ -31,6 +31,7 @@
import org.jboss.remoting.network.NetworkInstance;
import org.jboss.remoting.network.NetworkRegistryFinder;
import org.jboss.remoting.network.NetworkRegistryMBean;
+import org.jboss.remoting.network.NetworkRegistryWrapper;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -61,9 +62,10 @@
*/
public abstract class AbstractDetector implements AbstractDetectorMBean
{
+ static protected final Logger log = Logger.getLogger(AbstractDetector.class);
+
private long defaultTimeDelay = 5000;
private long heartbeatTimeDelay = 1000;
- protected final Logger log = Logger.getLogger(getClass());
protected MBeanServer mbeanserver;
protected ObjectName objectName;
protected ObjectName registryObjectName;
@@ -208,13 +210,11 @@
}
else
{
- networkRegistry = (NetworkRegistryMBean)AccessController.doPrivileged( new PrivilegedAction()
- {
- public Object run()
- {
- return MBeanServerInvocationHandler.newProxyInstance(mbeanserver, registryObjectName, NetworkRegistryMBean.class, false);
- }
- });
+ Object o = MBeanServerInvocationHandler.newProxyInstance(mbeanserver,
+ registryObjectName,
+ NetworkRegistryMBean.class,
+ false);
+ networkRegistry = new NetworkRegistryWrapper((NetworkRegistryMBean) o);
}
startPinger(getPingerDelay(), getPingerPeriod());
16 years, 4 months
JBoss Remoting SVN: r4127 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 19:30:30 -0400 (Wed, 07 May 2008)
New Revision: 4127
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
Log:
JBREM-977: Wraps CallbackErrorHandler and CallbackStore MBean proxies.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2008-05-07 23:29:45 UTC (rev 4126)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/ServerInvokerCallbackHandler.java 2008-05-07 23:30:30 UTC (rev 4127)
@@ -383,6 +383,7 @@
storeObjectName,
SerializableStore.class,
false);
+ callbackStore = new CallbackStoreWrapper(callbackStore);
}
}
catch(Exception ex)
@@ -460,6 +461,7 @@
errorHandlerObjectName,
CallbackErrorHandler.class,
false);
+ callbackErrorHandler = new CallbackErrorHandlerWrapper(callbackErrorHandler);
}
}
catch(Exception ex)
16 years, 4 months
JBoss Remoting SVN: r4126 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 19:29:45 -0400 (Wed, 07 May 2008)
New Revision: 4126
Added:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStoreWrapper.java
Log:
JBREM-977: A new wrapper for CallbackStore MBean proxies.
Added: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStoreWrapper.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStoreWrapper.java (rev 0)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackStoreWrapper.java 2008-05-07 23:29:45 UTC (rev 4126)
@@ -0,0 +1,276 @@
+
+/*
+* 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.remoting.callback;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+
+import org.jboss.remoting.SerializableStore;
+import org.jboss.remoting.util.SecurityUtility;
+
+/**
+ * A CallbackStoreWrapper is used to wrap an MBean proxy that implements
+ * org.jboss.remoting.SerializableStore. If necessary, each call will go
+ * through an AccessController.doPrivileged() call.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 5, 2008
+ * </p>
+ */
+public class CallbackStoreWrapper implements SerializableStore
+{
+ private SerializableStore proxy;
+
+
+ public CallbackStoreWrapper(SerializableStore proxy)
+ {
+ this.proxy = proxy;
+ }
+
+ public void add(final Serializable object) throws IOException
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.add(object);
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ proxy.add(object);
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+ public void create() throws Exception
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.create();
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ proxy.create();
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+ }
+
+ public void destroy()
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.destroy();
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.destroy();
+ return null;
+ }
+ });
+ }
+
+ public Object getNext() throws IOException
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ return proxy.getNext();
+ }
+
+ try
+ {
+ return AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws IOException
+ {
+ return proxy.getNext();
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (IOException) e.getCause();
+ }
+ }
+
+ public boolean getPurgeOnShutdown()
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ return proxy.getPurgeOnShutdown();
+ }
+
+ return ((Boolean) AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Boolean(proxy.getPurgeOnShutdown());
+ }
+ })).booleanValue();
+ }
+
+ public void purgeFiles()
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.purgeFiles();
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.purgeFiles();
+ return null;
+ }
+ });
+ }
+
+ public void setConfig(final Map config)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setConfig(config);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setConfig(config);
+ return null;
+ }
+ });
+ }
+
+ public void setPurgeOnShutdown(final boolean purgeOnShutdown)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setPurgeOnShutdown(purgeOnShutdown);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setPurgeOnShutdown(purgeOnShutdown);
+ return null;
+ }
+ });
+ }
+
+ public int size()
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ return proxy.size();
+ }
+
+ return ((Integer) AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Integer(proxy.size());
+ }
+ })).intValue();
+ }
+
+ public void start() throws Exception
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.start();
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ proxy.start();
+ return null;
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+ }
+
+ public void stop()
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.stop();
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.stop();
+ return null;
+ }
+ });
+ }
+}
\ No newline at end of file
16 years, 4 months
JBoss Remoting SVN: r4125 - remoting2/branches/2.x/src/main/org/jboss/remoting/callback.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 19:29:13 -0400 (Wed, 07 May 2008)
New Revision: 4125
Added:
remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackErrorHandlerWrapper.java
Log:
JBREM-977: A new wrapper for CallbackErrorHandler MBean proxies.
Added: remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackErrorHandlerWrapper.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackErrorHandlerWrapper.java (rev 0)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/callback/CallbackErrorHandlerWrapper.java 2008-05-07 23:29:13 UTC (rev 4125)
@@ -0,0 +1,144 @@
+
+/*
+* 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.remoting.callback;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.util.SecurityUtility;
+
+/**
+ * A CallbackErrorHandlerWrapper is used to wrap an MBean proxy that implements
+ * org.jboss.remoting.callback.CallbackErrorHandler. If necessary, each call
+ * will go through an AccessController.doPrivileged() call.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 5, 2008
+ * </p>
+ */
+public class CallbackErrorHandlerWrapper implements CallbackErrorHandler
+{
+ private CallbackErrorHandler proxy;
+
+ public CallbackErrorHandlerWrapper(CallbackErrorHandler proxy)
+ {
+ this.proxy = proxy;
+ }
+
+ public void handleError(final Throwable ex) throws Throwable
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.handleError(ex);
+ return;
+ }
+
+ try
+ {
+ AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ try
+ {
+ proxy.handleError(ex);
+ return null;
+ }
+ catch (Throwable e)
+ {
+ throw new Exception(ex);
+ }
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause.getCause() == null)
+ throw cause;
+ throw cause.getCause();
+ }
+ }
+
+ public void setCallbackHandler(final ServerInvokerCallbackHandler serverInvokerCallbackHandler)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setCallbackHandler(serverInvokerCallbackHandler);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setCallbackHandler(serverInvokerCallbackHandler);
+ return null;
+ }
+ });
+ }
+
+ public void setConfig(final Map errorHandlerConfig)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setConfig(errorHandlerConfig);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setConfig(errorHandlerConfig);
+ return null;
+ }
+ });
+ }
+
+ public void setServerInvoker(final ServerInvoker owner)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setServerInvoker(owner);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setServerInvoker(owner);
+ return null;
+ }
+ });
+ }
+
+}
+
16 years, 4 months
JBoss Remoting SVN: r4124 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 04:18:28 -0400 (Wed, 07 May 2008)
New Revision: 4124
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java
Log:
JBREM-977: (1) Treats passed ServerInvocationHandlers as if they might be proxies; (2) wraps newly created ServerInvocationHandler proxies.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java 2008-05-07 08:05:58 UTC (rev 4123)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/Connector.java 2008-05-07 08:18:28 UTC (rev 4124)
@@ -28,6 +28,7 @@
import org.jboss.remoting.InvokerRegistry;
import org.jboss.remoting.ServerConfiguration;
import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvocationHandlerWrapper;
import org.jboss.remoting.ServerInvoker;
import org.jboss.remoting.marshal.MarshalFactory;
import org.jboss.remoting.marshal.MarshallLoaderFactory;
@@ -45,8 +46,6 @@
import javax.management.ObjectName;
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
@@ -891,6 +890,7 @@
objName,
ServerInvocationHandler.class,
false);
+ handler = new ServerInvocationHandlerWrapper(handler);
}
else
{
@@ -1212,7 +1212,7 @@
* description = "The ServerInvocationHandler we are registering
* for the subsystem"
*/
- public ServerInvocationHandler addInvocationHandler(String subsystem, ServerInvocationHandler handler)
+ public ServerInvocationHandler addInvocationHandler(String subsystem, final ServerInvocationHandler handler)
throws Exception
{
if (invoker == null)
@@ -1220,7 +1220,15 @@
throw new IllegalStateException("You may only add handlers once the Connector is created (via create() method).");
}
- handler.setMBeanServer(server);
+ // In case handler is an MBean.
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ handler.setMBeanServer(server);
+ return null;
+ }
+ });
return invoker.addInvocationHandler(subsystem, handler);
}
16 years, 4 months
JBoss Remoting SVN: r4123 - remoting2/branches/2.x/src/main/org/jboss/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-07 04:05:58 -0400 (Wed, 07 May 2008)
New Revision: 4123
Added:
remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvocationHandlerWrapper.java
Log:
JBREM-977: A new wrapper for ServerInvocationHandler MBean proxies.
Added: remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvocationHandlerWrapper.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvocationHandlerWrapper.java (rev 0)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ServerInvocationHandlerWrapper.java 2008-05-07 08:05:58 UTC (rev 4123)
@@ -0,0 +1,160 @@
+
+/*
+* 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.remoting;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import javax.management.MBeanServer;
+
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.util.SecurityUtility;
+
+/**
+ * A ServerInvocationHandlerWrapper is used to wrap an MBean proxy that implements
+ * org.jboss.remoting.ServerInvocationHandler. If necessary, each call will go
+ * through an AccessController.doPrivileged() call.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright May 4, 2008
+ * </p>
+ */
+public class ServerInvocationHandlerWrapper implements ServerInvocationHandler
+{
+ private ServerInvocationHandler proxy;
+
+ public ServerInvocationHandlerWrapper(ServerInvocationHandler proxy)
+ {
+ this.proxy = proxy;
+ }
+
+ public void addListener(final InvokerCallbackHandler callbackHandler)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.addListener(callbackHandler);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.addListener(callbackHandler);
+ return null;
+ }
+ });
+ }
+
+ public Object invoke(final InvocationRequest invocation) throws Throwable
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ return proxy.invoke(invocation);
+ }
+
+ try
+ {
+ return AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ try
+ {
+ return proxy.invoke(invocation);
+ }
+ catch (Throwable t)
+ {
+ throw new Exception(t);
+ }
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause.getCause() == null)
+ throw cause;
+ else
+ throw cause.getCause();
+ }
+ }
+
+ public void removeListener(final InvokerCallbackHandler callbackHandler)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.removeListener(callbackHandler);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.removeListener(callbackHandler);
+ return null;
+ }
+ });
+ }
+
+ public void setInvoker(final ServerInvoker invoker)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setInvoker(invoker);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setInvoker(invoker);
+ return null;
+ }
+ });
+ }
+
+ public void setMBeanServer(final MBeanServer server)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ proxy.setMBeanServer(server);
+ return;
+ }
+
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ proxy.setMBeanServer(server);
+ return null;
+ }
+ });
+ }
+}
\ No newline at end of file
16 years, 4 months
JBoss Remoting SVN: r4122 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/serversocketrefresh.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-02 23:22:16 -0400 (Fri, 02 May 2008)
New Revision: 4122
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/serversocketrefresh/SSLBisocketTestCase.java
Log:
JBREM-930: Extended timeouts.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/serversocketrefresh/SSLBisocketTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/serversocketrefresh/SSLBisocketTestCase.java 2008-05-02 06:39:02 UTC (rev 4121)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/ssl/serversocketrefresh/SSLBisocketTestCase.java 2008-05-03 03:22:16 UTC (rev 4122)
@@ -1,6 +1,7 @@
package org.jboss.test.remoting.transport.bisocket.ssl.serversocketrefresh;
import org.apache.log4j.Level;
import org.jboss.jrunit.harness.TestDriver;
+import org.jboss.logging.XLevel;
/**
* JBREM-427 load a new keystore at runtime<br>
@@ -22,6 +23,16 @@
protected Level getTestLogLevel()
{
- return Level.ERROR;
+ return XLevel.TRACE;
}
+
+ protected long getResultsTimeout()
+ {
+ return 480000;
+ }
+
+ protected long getRunTestTimeout()
+ {
+ return 480000;
+ }
}
16 years, 4 months
JBoss Remoting SVN: r4121 - 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: 2008-05-02 02:39:02 -0400 (Fri, 02 May 2008)
New Revision: 4121
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketTestCase.java
Log:
JBREM-930: In testServerSlowRestart() and testServerQuickRestart(), close old Connector before retrying..
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketTestCase.java 2008-05-02 05:07:39 UTC (rev 4120)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/bisocket/BisocketTestCase.java 2008-05-02 06:39:02 UTC (rev 4121)
@@ -1795,6 +1795,7 @@
catch (Exception e)
{
log.info("unable to restart connector: retrying in 60 seconds");
+ tearDown();
Thread.sleep(60000);
}
}
@@ -1884,6 +1885,7 @@
catch (Exception e)
{
log.info("unable to restart connector: retrying in 60 seconds");
+ tearDown();
Thread.sleep(60000);
}
}
@@ -1965,7 +1967,7 @@
{
try
{
- internalSetUp(port);
+ internalSetUp(port);
break;
}
catch (Exception e)
16 years, 4 months
JBoss Remoting SVN: r4120 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-02 01:07:39 -0400 (Fri, 02 May 2008)
New Revision: 4120
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java
Log:
JBREM-930: Registers Connector with MBeanServer earlier.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java 2008-05-02 05:07:05 UTC (rev 4119)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java 2008-05-02 05:07:39 UTC (rev 4120)
@@ -84,13 +84,13 @@
connector = new Connector(config);
connector.setInvokerLocator(locator.getLocatorURI());
+
+ ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
+ server.registerMBean(connector, obj);
connector.create();
TestHandler handler = new TestHandler();
connector.addInvocationHandler("mock", handler);
-
- ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator.getProtocol());
- server.registerMBean(connector, obj);
connector.start();
//Need to set new domain for identity
16 years, 4 months
JBoss Remoting SVN: r4119 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-05-02 01:07:05 -0400 (Fri, 02 May 2008)
New Revision: 4119
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java
Log:
JBREM-930: Ignores extraneous servers.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java 2008-05-02 03:31:16 UTC (rev 4118)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java 2008-05-02 05:07:05 UTC (rev 4119)
@@ -59,13 +59,28 @@
System.out.println("instance = " + instances);
System.out.println("force detection took " + (end - start) + " milliseconds.");
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+
// assertEquals(1, instances.length);
// now create a client
- NetworkInstance ni = instances[0];
- InvokerLocator[] locator = ni.getLocators();
- InvokerLocator serverLocator = locator[0];
+ InvokerLocator serverLocator = null;
+ for (int i = 0; i < instances.length; i++)
+ {
+ NetworkInstance ni = instances[i];
+ InvokerLocator[] locator = ni.getLocators();
+ for (int j = 0; j < locator.length; j++)
+ {
+ if (locator[j].getHost().equals(bindAddr))
+ {
+ serverLocator = locator[j];
+ break;
+ }
+ }
+ }
+ System.out.println("client connecting to " + serverLocator);
Map config = new HashMap();
config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
String trustStoreFilePath = this.getClass().getResource("ssl/.truststore").getFile();
@@ -79,8 +94,6 @@
remotingClient = new Client(serverLocator, config);
remotingClient.connect();
- String host = InetAddress.getLocalHost().getHostAddress();
- String bindAddr = System.getProperty("jrunit.bind_addr", host);
String invokerLocatorurl = "sslsocket://" + bindAddr + ":8700";
connector = new Connector(invokerLocatorurl, config);
connector.create();
16 years, 4 months