2
* JBoss, Home of Professional Open Source
4
* Distributable under LGPL license.
5
* See terms of license at gnu.org.
7
package org.jboss.test.remoting.transport.socket.serverlockup;
9
import org.jboss.remoting.ServerInvocationHandler;
10
import org.jboss.remoting.ServerInvoker;
11
import org.jboss.remoting.InvocationRequest;
12
import org.jboss.remoting.invocation.NameBasedInvocation;
13
import org.jboss.remoting.callback.InvokerCallbackHandler;
14
import org.jboss.logging.Logger;
16
import javax.management.MBeanServer;
19
* @author <a href="mailto:ovidiu@jboss.org">Ovidiu Feodorov</a>
20
* @version <tt>$Revision: 1814 $</tt>
22
* $Id: SimpleServerInvocationHandler.java 1814 2007-01-13 12:42:36Z ovidiu $
24
public class SimpleServerInvocationHandler implements ServerInvocationHandler
26
// Constants ------------------------------------------------------------------------------------
28
private static final Logger log = Logger.getLogger(SimpleServerInvocationHandler.class);
30
// Static ---------------------------------------------------------------------------------------
32
// Attributes -----------------------------------------------------------------------------------
34
// Constructors ---------------------------------------------------------------------------------
36
// ServerInvocationHandler implementation -------------------------------------------------------
38
public void setMBeanServer(MBeanServer server)
42
public void setInvoker(ServerInvoker invoker)
46
public Object invoke(InvocationRequest invocation) throws Throwable
48
NameBasedInvocation nbi = (NameBasedInvocation)invocation.getParameter();
50
String methodName = nbi.getMethodName();
52
if ("ping".equals(methodName))
54
return "pong." + nbi.getParameters()[0];
60
public void addListener(InvokerCallbackHandler callbackHandler)
64
public void removeListener(InvokerCallbackHandler callbackHandler)
68
// Public ---------------------------------------------------------------------------------------
70
// Package protected ----------------------------------------------------------------------------
72
// Protected ------------------------------------------------------------------------------------
74
// Private --------------------------------------------------------------------------------------
76
// Inner classes --------------------------------------------------------------------------------