JBoss Remoting SVN: r3655 - 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-17 03:36:12 -0400 (Mon, 17 Mar 2008)
New Revision: 3655
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-933: Clears client socket factory when it shuts down.
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-17 07:35:18 UTC (rev 3654)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java 2008-03-17 07:36:12 UTC (rev 3655)
@@ -86,6 +86,7 @@
protected boolean rmiOnewayMarshalling;
private Remote stub;
+ private RemotingRMIClientSocketFactory csf;
/**
@@ -190,7 +191,7 @@
locator.setHomeInUse(bindHome);
RMIServerSocketFactory ssf = new RemotingRMIServerSocketFactory(getServerSocketFactory(), BACKLOG_DEFAULT, bindHost, getTimeout());
- RMIClientSocketFactory csf = getRMIClientSocketFactory(clientConnectHost);
+ csf = getRMIClientSocketFactory(clientConnectHost);
stub = UnicastRemoteObject.exportObject(this, bindPort, csf, ssf);
log.debug("Binding server to \"remoting/RMIServerInvoker/" + bindPort + "\" in registry");
@@ -201,7 +202,7 @@
}
- protected RMIClientSocketFactory getRMIClientSocketFactory(String clientConnectHost)
+ protected RemotingRMIClientSocketFactory getRMIClientSocketFactory(String clientConnectHost)
{
// Remove server side socket creation listeners.
HashMap remoteConfig = new HashMap(configuration);
@@ -313,6 +314,8 @@
}
+ csf.clear();
+
if (isPrimaryServer)
{
Iterator it = secondaryServers.iterator();
16 years, 9 months
JBoss Remoting SVN: r3654 - 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-17 03:35:18 -0400 (Mon, 17 Mar 2008)
New Revision: 3654
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIClientSocketFactory.java
Log:
JBREM-933: Added removeLocalConfiguration() and clear().
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIClientSocketFactory.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIClientSocketFactory.java 2008-03-17 07:33:27 UTC (rev 3653)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RemotingRMIClientSocketFactory.java 2008-03-17 07:35:18 UTC (rev 3654)
@@ -28,6 +28,7 @@
import java.net.Socket;
import java.net.UnknownHostException;
import java.rmi.server.RMIClientSocketFactory;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -77,8 +78,8 @@
static final long serialVersionUID;
protected static Logger log = Logger.getLogger(RemotingRMIClientSocketFactory.class);
- protected static HashMap configMaps = new HashMap();
- protected static Map socketFactories = new HashMap();
+ protected static Map configMaps = Collections.synchronizedMap(new HashMap());
+ protected static Map socketFactories = Collections.synchronizedMap(new HashMap());
protected Map configuration;
protected InvokerLocator invokerLocator;
@@ -120,6 +121,16 @@
configMaps.put(new ComparableHolder(invokerLocator), localConfig);
}
+
+ public static void removeLocalConfiguration(InvokerLocator invokerLocator)
+ {
+ log.debug("removing local configuration for: " + invokerLocator);
+ Object o = configMaps.remove(new ComparableHolder(invokerLocator));
+ if (o == null) log.warn("trying to delete unknown key: " + invokerLocator);
+ ComparableHolder holder = new ComparableHolder(invokerLocator);
+ socketFactories.remove(holder);
+ }
+
/**
* @param locator
@@ -207,7 +218,7 @@
public SocketFactory retrieveSocketFactory(ComparableHolder holder)
throws IOException
{
- SocketFactory sf = (SocketFactory) socketFactories.get(this);
+ SocketFactory sf = (SocketFactory) socketFactories.get(holder);
if (sf == null)
{
// We want to keep the local configuration map, which might contain a
@@ -229,12 +240,20 @@
sf = AbstractInvoker.wrapSocketFactory(sf, tempConfig);
}
- socketFactories.put(this, sf);
+ socketFactories.put(holder, sf);
}
return sf;
}
+
+ public void clear()
+ {
+ configuration = null;
+ invokerLocator = null;
+ socketFactory = null;
+ }
+
protected static class ComparableHolder
{
16 years, 9 months
JBoss Remoting SVN: r3653 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/socketfactory.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-17 03:33:27 -0400 (Mon, 17 Mar 2008)
New Revision: 3653
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/socketfactory/RMIClientSocketFactoryMemoryLeakTestCase.java
Log:
JBREM-933: New unit test.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/socketfactory/RMIClientSocketFactoryMemoryLeakTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/socketfactory/RMIClientSocketFactoryMemoryLeakTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/rmi/socketfactory/RMIClientSocketFactoryMemoryLeakTestCase.java 2008-03-17 07:33:27 UTC (rev 3653)
@@ -0,0 +1,177 @@
+/*
+* 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.rmi.socketfactory;
+
+import java.lang.reflect.Field;
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.PortUtil;
+import org.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory;
+
+
+/**
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1846 $
+ * <p>
+ * Copyright March 16, 2008
+ * </p>
+ */
+public class RMIClientSocketFactoryMemoryLeakTestCase extends TestCase
+{
+ private static Logger log = Logger.getLogger(RMIClientSocketFactoryMemoryLeakTestCase.class);
+
+ private static boolean firstTime = true;
+
+ protected String host;
+ protected int port;
+ protected String locatorURI;
+ protected InvokerLocator serverLocator;
+ protected Connector connector;
+ protected TestInvocationHandler invocationHandler;
+
+
+ public void setUp() throws Exception
+ {
+ if (firstTime)
+ {
+ firstTime = false;
+ Logger.getLogger("org.jboss.remoting").setLevel(Level.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);
+ ConsoleAppender consoleAppender = new ConsoleAppender(layout);
+ Logger.getRootLogger().addAppender(consoleAppender);
+ log.info("java.version: " + System.getProperty("java.version"));
+ }
+ }
+
+
+ public void tearDown()
+ {
+ }
+
+
+ public void testMemoryLeak() throws Throwable
+ {
+ log.info("entering " + getName());
+ setupServer();
+
+ // Create client.
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(serverLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Verify configuration map has been stored in RemotingRMIClientSocketFactory.
+ Field field = RemotingRMIClientSocketFactory.class.getDeclaredField("configMaps");
+ field.setAccessible(true);
+ Map configMaps = (Map) field.get(null);
+ assertEquals(1, configMaps.size());
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Verify that a SocketFactory has been created and saved.
+ field = RemotingRMIClientSocketFactory.class.getDeclaredField("socketFactories");
+ field.setAccessible(true);
+ Map socketFactories = (Map) field.get(null);
+ assertEquals(1, configMaps.size());
+
+ // Verify configuration map is removed from RemotingRMIClientSocketFactory.configMaps
+ // and SocketFactory is removed from RemotingRMIClientSocketFactory.socketFactories
+ // after client invoker is disconnected.
+ client.disconnect();
+ assertEquals(0, configMaps.size());
+ assertEquals(0, configMaps.size());
+
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ protected String getTransport()
+ {
+ return "rmi";
+ }
+
+
+ protected void addExtraClientConfig(Map config) {}
+ protected void addExtraServerConfig(Map config) {}
+
+
+ protected void setupServer() throws Exception
+ {
+ host = InetAddress.getLocalHost().getHostAddress();
+ port = PortUtil.findFreePort(host);
+ locatorURI = getTransport() + "://" + host + ":" + port;
+ serverLocator = new InvokerLocator(locatorURI);
+ log.info("Starting remoting server with locator uri of: " + locatorURI);
+ HashMap config = new HashMap();
+ config.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraServerConfig(config);
+ connector = new Connector(serverLocator, config);
+ connector.create();
+ invocationHandler = new TestInvocationHandler();
+ connector.addInvocationHandler("test", invocationHandler);
+ connector.start();
+ }
+
+
+ protected void shutdownServer() throws Exception
+ {
+ if (connector != null)
+ connector.stop();
+ }
+
+
+ static class TestInvocationHandler implements ServerInvocationHandler
+ {
+ public void addListener(InvokerCallbackHandler callbackHandler) {}
+ public Object invoke(final InvocationRequest invocation) throws Throwable
+ {
+ return invocation.getParameter();
+ }
+ public void removeListener(InvokerCallbackHandler callbackHandler) {}
+ public void setMBeanServer(MBeanServer server) {}
+ public void setInvoker(ServerInvoker invoker) {}
+ }
+}
\ No newline at end of file
16 years, 9 months
JBoss Remoting SVN: r3652 - 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-16 01:32:06 -0400 (Sun, 16 Mar 2008)
New Revision: 3652
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java
Log:
JBREM-932: In transport() checks remaining time > 0 before resetting socket's SO_TIMEOUT value.
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-15 09:10:59 UTC (rev 3651)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/socket/MicroSocketClientInvoker.java 2008-03-16 05:32:06 UTC (rev 3652)
@@ -743,8 +743,11 @@
if (tempTimeout >= 0)
{
- savedTimeout = socketWrapper.getTimeout();
- socketWrapper.setTimeout((int) (tempTimeout - (System.currentTimeMillis() - start)));
+ timeLeft = (int) (tempTimeout - (System.currentTimeMillis() - start));
+ if (timeLeft <= 0)
+ break;
+ savedTimeout = socketWrapper.getTimeout();
+ socketWrapper.setTimeout(timeLeft);
}
long end = System.currentTimeMillis() - start;
16 years, 9 months
JBoss Remoting SVN: r3651 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-15 05:10:59 -0400 (Sat, 15 Mar 2008)
New Revision: 3651
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ClientLauncher.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/HeavyComputeClient.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockEJBClient.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockJBMClient.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/SoakConstants.java
Log:
JBREM-931: Updated soak test.
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ClientLauncher.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ClientLauncher.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ClientLauncher.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -66,7 +66,8 @@
private static String host;
private static boolean creationDone;
- private static long DURATION = 3000;
+ private static long DURATION = 3600000;
+ private static int MAX_CLIENTS = 20;
public static void main(String[] args)
{
@@ -82,13 +83,19 @@
host = InetAddress.getLocalHost().getHostAddress();
random = new Random(System.currentTimeMillis());
Timer timer = new Timer(false);
- timer.schedule(new DisplayTimerTask(), 5000, 5000);
+ timer.schedule(new DisplayTimerTask(), 30000, 30000);
long start = System.currentTimeMillis();
-
+
while (System.currentTimeMillis() - start < DURATION)
{
- createClient();
- int n = random.nextInt(30) * 100;
+ if (mockEJBClientCurrentCounter.getCount() +
+ mockJBMClientCurrentCounter.getCount() +
+ heavyComputeClientCurrentCounter.getCount() < MAX_CLIENTS)
+ {
+ createClient();
+ }
+
+ int n = random.nextInt(80) * 100;
log.debug("waiting " + n + " ms");
Thread.sleep(n);
}
@@ -106,6 +113,7 @@
protected static void createClient() throws Throwable
{
int k = random.nextInt(4);
+ k = 3;
String transport = transports[k];
int port = ports[k];
transportCounters[k]++;
@@ -128,12 +136,12 @@
protected static void createMockEJBClient(String transport, int port) throws Throwable
{
- String locatorURI = transport + "://" + host + ":" + port;
+ String locatorURI = transport + "://" + host + ":" + port + "/?timeout=0";
Map metadata = new HashMap();
- metadata.put(NAME, "MockEJBClient" + mockEJBClientCounter.increment());
+ metadata.put(NAME, "MockEJBClient" + mockEJBClientCounter.increment() + "[" + transport + "]");
metadata.put(COUNTER, mockEJBClientCurrentCounter);
metadata.put(FAILURE_COUNTER, mockEJBClientFailureCounter);
- metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(20000)));
+ metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(2000)));
MockEJBClient c = new MockEJBClient(locatorURI, metadata);
Thread t = new Thread(c);
t.start();
@@ -142,13 +150,13 @@
protected static void createMockJBMClient(String transport, int port) throws Throwable
{
- String locatorURI = transport + "://" + host + ":" + port;
+ String locatorURI = transport + "://" + host + ":" + port + "/?timeout=0";
Map metadata = new HashMap();
- metadata.put(NAME, "MockJBMClient" + mockJBMClientCounter.increment());
+ metadata.put(NAME, "MockJBMClient" + mockJBMClientCounter.increment() + "[" + transport + "]");
metadata.put(COUNTER, mockJBMClientCurrentCounter);
metadata.put(FAILURE_COUNTER, mockJBMClientFailureCounter);
- metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(5000)));
- metadata.put(NUMBER_OF_CALLBACKS, Integer.toString(random.nextInt(8)));
+ metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(1000)));
+ metadata.put(NUMBER_OF_CALLBACKS, Integer.toString(random.nextInt(3)));
MockJBMClient c = new MockJBMClient(locatorURI, metadata);
Thread t = new Thread(c);
t.start();
@@ -157,13 +165,13 @@
protected static void createHeavyComputeClient(String transport, int port) throws Throwable
{
- String locatorURI = transport + "://" + host + ":" + port;
+ String locatorURI = transport + "://" + host + ":" + port + "/?timeout=0";
Map metadata = new HashMap();
- metadata.put(NAME, "HeavyComputeClient" + heavyComputeClientCounter.increment());
+ metadata.put(NAME, "HeavyComputeClient" + heavyComputeClientCounter.increment() + "[" + transport + "]");
metadata.put(COUNTER, heavyComputeClientCurrentCounter);
metadata.put(FAILURE_COUNTER, heavyComputeClientFailureCounter);
- metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(10)));
- metadata.put(SPIN_TIME, "10000");
+ metadata.put(NUMBER_OF_CALLS, Integer.toString(random.nextInt(5)));
+ metadata.put(SPIN_TIME, "4000");
HeavyComputeClient c = new HeavyComputeClient(locatorURI, metadata);
heavyComputeClientCounter.increment();
Thread t = new Thread(c);
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/HeavyComputeClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/HeavyComputeClient.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/HeavyComputeClient.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -84,15 +84,29 @@
protected void makeCall(int i) throws Throwable
{
- Client client = new Client(locator);
- client.connect();
- Object response = client.invoke(SPIN, metadata);
- if (!"done".equals(response))
+ Client client = null;
+
+ try
{
+ client = new Client(locator);
+ client.connect();
+ Object response = client.invoke(SPIN, metadata);
+ if (!"done".equals(response))
+ {
+ ok = false;
+ log.info(name + ": failure on call " + i);
+ }
+ }
+ catch (Throwable t)
+ {
ok = false;
log.info(name + ": failure on call " + i);
+ throw t;
}
- client.disconnect();
+ finally
+ {
+ client.disconnect();
+ }
}
}
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockEJBClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockEJBClient.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockEJBClient.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -81,20 +81,34 @@
if (!ok) failureCounter.increment();
}
}
-
+
protected void makeCall(int i) throws Throwable
{
- Client client = new Client(locator);
- client.connect();
- Map metadata = new HashMap();
- metadata.put(PAYLOAD, "abc");
- Object response = client.invoke(COPY, metadata);
- if (!"abc".equals(response))
+ Client client = null;
+
+ try
{
+ client = new Client(locator);
+ client.connect();
+ Map metadata = new HashMap();
+ metadata.put(PAYLOAD, "abc");
+ Object response = client.invoke(COPY, metadata);
+ if (!"abc".equals(response))
+ {
+ ok = false;
+ log.info(name + ": failure on call " + i);
+ }
+ }
+ catch (Throwable t)
+ {
ok = false;
log.info(name + ": failure on call " + i);
+ throw t;
}
- client.disconnect();
+ finally
+ {
+ client.disconnect();
+ }
}
}
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockJBMClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockJBMClient.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/MockJBMClient.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -30,6 +30,7 @@
import org.jboss.remoting.callback.Callback;
import org.jboss.remoting.callback.HandleCallbackException;
import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.bisocket.Bisocket;
/**
* @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
@@ -69,7 +70,12 @@
client.connect();
TestCallbackHandler callbackHandler = new TestCallbackHandler();
Map callbackMetadata = new HashMap();
+ if ("bisocket".equals(locator.getProtocol()))
+ {
+ callbackMetadata.put(Bisocket.IS_CALLBACK_SERVER, "true");
+ }
client.addListener(callbackHandler, callbackMetadata, null, true);
+ log.debug(client.getSessionId() + ": added callback listener");
String s = (String) metadata.get(NUMBER_OF_CALLS);
int calls = Integer.valueOf(s).intValue();
for (int i = 0; i < calls; i++)
@@ -89,9 +95,11 @@
catch (Throwable t)
{
log.error(name, t);
+ ok = false;
}
finally
{
+ client.disconnect();
log.info(name + ": " + (ok ? "PASS" : "FAIL"));
counter.decrement();
if (!ok) failureCounter.increment();
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/ServerLauncher.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -88,7 +88,7 @@
connector = setupServer(host, 6669, "socket");
locators.put("socket", connector.getLocator().getLocatorURI());
- log.info("servers: " + locators);
+ log.info("SERVERS CREATED: " + locators);
}
catch (Exception e)
{
@@ -99,7 +99,7 @@
protected static Connector setupServer(String host, int port, String transport) throws Exception
{
- String locatorURI = transport + "://" + host + ":" + port;
+ String locatorURI = transport + "://" + host + ":" + port + "/?timeout=0";
InvokerLocator serverLocator = new InvokerLocator(locatorURI);
log.info("Starting remoting server with locator uri of: " + locatorURI);
HashMap config = new HashMap();
@@ -120,12 +120,13 @@
public void addListener(InvokerCallbackHandler callbackHandler)
{
+ log.debug("entering addListener()");
synchronized (lock)
{
String id = ((ServerInvokerCallbackHandler)callbackHandler).getClientSessionId();
listeners.put(id, callbackHandler);
}
- log.debug("added InvokerCallbackHandler");
+ log.debug("added InvokerCallbackHandler: " + listeners);
}
public Object invoke(final InvocationRequest invocation) throws Throwable
@@ -161,6 +162,11 @@
callbackHandler = (InvokerCallbackHandler) listeners.get(id);
}
+ if (callbackHandler == null)
+ {
+ log.info("sessionId: " + id);
+ log.info("listeners: " + listeners);
+ }
Callback callback = new Callback("callback");
for (int i = 0; i < callbacks; i++)
{
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/SoakConstants.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/SoakConstants.java 2008-03-15 03:04:24 UTC (rev 3650)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/soak/SoakConstants.java 2008-03-15 09:10:59 UTC (rev 3651)
@@ -31,14 +31,16 @@
*/
public class SoakConstants
{
- public static final int SENDERS = 5;
+ public static final int SENDERS = 5;
public static final int CALLBACK_LISTENERS = 5;
- public static final int DURATION = 30000;
+ public static final int DURATION = 36000000;
- public static final int INTERVAL = 1000;
+ public static final int INTERVAL = 1000000;
+ public static final String locator = "://localhost:5678";
+
public static final String NUMBER_OF_CALLS = "numberOfCalls";
public static final String NAME = "name";
16 years, 9 months
JBoss Remoting SVN: r3650 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/registry.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-14 23:04:24 -0400 (Fri, 14 Mar 2008)
New Revision: 3650
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/registry/NetworkRegistryTestCase.java
Log:
JBREM-930: Uses value of System property "jrunit.bind_addr" instead of "localhost".
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/registry/NetworkRegistryTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/registry/NetworkRegistryTestCase.java 2008-03-15 02:59:58 UTC (rev 3649)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/registry/NetworkRegistryTestCase.java 2008-03-15 03:04:24 UTC (rev 3650)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.remoting.detection.registry;
+import java.net.InetAddress;
+
import junit.framework.TestCase;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.detection.ServerInvokerMetadata;
@@ -65,7 +67,9 @@
MulticastDetector detector1 = new MulticastDetector();
int port = TestUtil.getRandomPort();
- InvokerLocator locator1 = new InvokerLocator("socket://localhost:" + port);
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+ InvokerLocator locator1 = new InvokerLocator("socket://" + bindAddr + ":" + port);
Connector connector1 = new Connector(locator1);
ObjectName obj = new ObjectName("jboss.remoting:type=Connector,transport=" + locator1.getProtocol());
server1.registerMBean(connector1, obj);
@@ -90,7 +94,7 @@
MulticastDetector detector2 = new MulticastDetector();
port = TestUtil.getRandomPort();
- InvokerLocator locator2 = new InvokerLocator("socket://localhost:" + port);
+ InvokerLocator locator2 = new InvokerLocator("socket://" + bindAddr + ":" + port);
Connector connector2 = new Connector(locator2);
ObjectName obj2 = new ObjectName("jboss.remoting:type=Connector,transport=" + locator2.getProtocol());
server2.registerMBean(connector2, obj2);
16 years, 9 months
JBoss Remoting SVN: r3649 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/startup.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-14 22:59:58 -0400 (Fri, 14 Mar 2008)
New Revision: 3649
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/startup/MulticastDetectorServer.java
Log:
JBREM-930: Uses value of System property "jrunit.bind_addr" instead of "localhost".
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/startup/MulticastDetectorServer.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/startup/MulticastDetectorServer.java 2008-03-15 02:58:51 UTC (rev 3648)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/startup/MulticastDetectorServer.java 2008-03-15 02:59:58 UTC (rev 3649)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.remoting.detection.multicast.startup;
+import java.net.InetAddress;
+
import org.apache.log4j.Level;
import org.jboss.jrunit.extensions.ServerTestCase;
import org.jboss.remoting.InvokerLocator;
@@ -58,7 +60,9 @@
int port = TestUtil.getRandomPort();
System.out.println("port = " + port);
- InvokerLocator locator = new InvokerLocator("socket://localhost:" + port);
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+ InvokerLocator locator = new InvokerLocator("socket://" + bindAddr + ":" + port);
System.out.println("Starting remoting server with locator uri of: " + locator.getLocatorURI());
connector = new Connector();
16 years, 9 months
JBoss Remoting SVN: r3648 - 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-03-14 22:58:51 -0400 (Fri, 14 Mar 2008)
New Revision: 3648
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/MulticastDetectorServer.java
Log:
JBREM-930: Uses value of System property "jrunit.bind_addr" instead of "localhost".
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-03-15 02:56:08 UTC (rev 3647)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java 2008-03-15 02:58:51 UTC (rev 3648)
@@ -16,6 +16,8 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
+
+import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;
@@ -77,7 +79,9 @@
remotingClient = new Client(serverLocator, config);
remotingClient.connect();
- String invokerLocatorurl = "sslsocket://localhost:8700";
+ 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();
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-03-15 02:56:08 UTC (rev 3647)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java 2008-03-15 02:58:51 UTC (rev 3648)
@@ -17,6 +17,8 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
+
+import java.net.InetAddress;
import java.util.HashMap;
import java.util.Map;
@@ -47,7 +49,9 @@
int port = TestUtil.getRandomPort();
System.out.println("port = " + port);
- InvokerLocator locator = new InvokerLocator("sslsocket://localhost:" + port);
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+ InvokerLocator locator = new InvokerLocator("sslsocket://" + bindAddr + ":" + port);
System.out.println("Starting remoting server with locator uri of: " + locator.getLocatorURI());
16 years, 9 months
JBoss Remoting SVN: r3647 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-14 22:56:08 -0400 (Fri, 14 Mar 2008)
New Revision: 3647
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/MulticastUnitTestCase.java
Log:
JBREM-930: Uses value of System property "jrunit.bind_addr" instead of "localhost".
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/MulticastUnitTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/MulticastUnitTestCase.java 2008-03-15 02:52:45 UTC (rev 3646)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/multicast/MulticastUnitTestCase.java 2008-03-15 02:56:08 UTC (rev 3647)
@@ -38,6 +38,7 @@
import javax.management.ObjectName;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
+import java.net.InetAddress;
import java.util.ArrayList;
/**
@@ -216,7 +217,9 @@
System.out.println("port = " + port);
- InvokerLocator locator = new InvokerLocator("socket://localhost:" + port);
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+ InvokerLocator locator = new InvokerLocator("socket://" + bindAddr + ":" + port);
StringBuffer buf = new StringBuffer();
buf.append("<?xml version=\"1.0\"?>\n");
buf.append("<handlers>\n");
16 years, 9 months
JBoss Remoting SVN: r3646 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-14 22:52:45 -0400 (Fri, 14 Mar 2008)
New Revision: 3646
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java
Log:
JBREM-930: Uses value of System property "jrunit.bind_addr" instead of "localhost".
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java 2008-03-15 02:52:06 UTC (rev 3645)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/detection/metadata/MetadataTestCase.java 2008-03-15 02:52:45 UTC (rev 3646)
@@ -40,6 +40,7 @@
import javax.management.ObjectName;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.ByteArrayInputStream;
+import java.net.InetAddress;
import java.util.List;
/**
@@ -132,9 +133,11 @@
//int port = Math.abs(new Random().nextInt(2000));
int port = TestUtil.getRandomPort();
System.out.println("port = " + port);
-
-
- InvokerLocator locator = new InvokerLocator("socket://localhost:" + port);
+
+ String host = InetAddress.getLocalHost().getHostAddress();
+ String bindAddr = System.getProperty("jrunit.bind_addr", host);
+ InvokerLocator locator = new InvokerLocator("socket://" + bindAddr + ":" + port);
+
StringBuffer buf = new StringBuffer();
buf.append("<?xml version=\"1.0\"?>\n");
buf.append("<handlers>\n");
16 years, 9 months