1 7 package org.jboss.test.remoting.callback.pull.memory.nullstore; 8 9 import org.jboss.jrunit.extensions.ServerTestCase; 10 import org.jboss.remoting.InvokerLocator; 11 import org.jboss.remoting.transport.Connector; 12 import org.jboss.test.remoting.callback.pull.memory.CallbackInvocationHandler; 13 14 20 public class CallbackTestServer extends ServerTestCase 21 { 22 private static String transport = "socket"; 24 private static String host = "localhost"; 25 private static int port = 5411; 26 27 private String locatorURI = transport + "://" + host + ":" + port; 28 29 private Connector connector; 30 31 private static final String RESPONSE_VALUE = "This is the return to SampleInvocationHandler invocation"; 33 34 35 public void setupServer() throws Exception 36 { 37 InvokerLocator locator = new InvokerLocator(locatorURI); 38 System.out.println("Starting remoting server with locator uri of: " + locatorURI); 39 connector = new Connector(); 40 connector.setInvokerLocator(locator.getLocatorURI()); 41 connector.start(); 42 43 CallbackInvocationHandler invocationHandler = new CallbackInvocationHandler(); 44 connector.addInvocationHandler("sample", invocationHandler); 46 } 47 48 public void setUp() throws Exception 49 { 50 setupServer(); 51 } 52 53 public void tearDown() throws Exception 54 { 55 if(connector != null) 56 { 57 connector.stop(); 58 connector.destroy(); 59 } 60 } 61 62 } | Popular Tags |