1
package org.jboss.test.remoting.transport.socket.stress;
3
import org.apache.log4j.Level;
4
import org.jboss.remoting.InvocationRequest;
5
import org.jboss.remoting.InvokerLocator;
6
import org.jboss.remoting.ServerInvocationHandler;
7
import org.jboss.remoting.ServerInvoker;
8
import org.jboss.remoting.callback.InvokerCallbackHandler;
9
import org.jboss.remoting.transport.Connector;
11
import javax.management.MBeanServer;
14
* @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
16
public class SocketInvokerServerTest
18
private Connector connector = null;
20
private int maxPoolSize = 300;
21
// private int maxPoolSize = 1000;
23
public String getTransport()
28
public void setUp() throws Exception
30
InvokerLocator locator = new InvokerLocator(getTransport() + "://" + "localhost" + ":" + 6700 + "/?" +
31
"MaxPoolSize=" + maxPoolSize);
32
connector = new Connector(locator);
35
connector.addInvocationHandler("test", new TestInvocationHandler());
40
public void tearDown()
49
public static void main(String[] args)
51
org.apache.log4j.BasicConfigurator.configure();
52
org.apache.log4j.Category.getRoot().setLevel(Level.INFO);
54
SocketInvokerServerTest server = new SocketInvokerServerTest();
58
// Thread.currentThread().sleep(300000);
59
Thread.currentThread().sleep(7200000);
61
System.out.println("Have torn down test.");
69
public class TestInvocationHandler implements ServerInvocationHandler
72
public void setMBeanServer(MBeanServer server)
74
//TODO: -TME Implement
77
public void setInvoker(ServerInvoker invoker)
79
//TODO: -TME Implement
82
public Object invoke(InvocationRequest invocation) throws Throwable
84
return invocation.getParameter();
87
public void addListener(InvokerCallbackHandler callbackHandler)
89
//TODO: -TME Implement
92
public void removeListener(InvokerCallbackHandler callbackHandler)
94
//TODO: -TME Implement