1 7 package org.jboss.test.remoting.interceptor; 8 9 import javax.management.MBeanServer ; 10 import org.jboss.logging.Logger; 11 import org.jboss.remoting.InvocationRequest; 12 import org.jboss.remoting.callback.InvokerCallbackHandler; 13 import org.jboss.remoting.ServerInvocationHandler; 14 import org.jboss.remoting.ServerInvoker; 15 16 19 public class TestInvocationHandler implements ServerInvocationHandler 20 { 21 private ServerInvoker invoker; 22 23 private static final Logger log = Logger.getLogger(TestInvocationHandler.class); 24 25 26 31 public void setInvoker(ServerInvoker invoker) 32 { 33 this.invoker = invoker; 34 } 35 36 41 public void setMBeanServer(MBeanServer server) 42 { 43 } 44 45 public Object invoke(InvocationRequest invocation) 46 throws Throwable 47 { 48 Object ret = null; 49 Object param = invocation.getParameter(); 50 if(param instanceof org.jboss.test.remoting.interceptor.TestInvocation) 51 { 52 Object obj = ((org.jboss.test.remoting.interceptor.TestInvocation) param).getArgument(); 53 if(obj instanceof TestTarget) 54 { 55 TestTarget testParamVal = (TestTarget) obj; 56 ret = new Boolean (new TestTarget().equals(testParamVal)); 57 } 58 } 59 else 60 { 61 log.info("Don't recognize the parameter type, so just returning it."); 62 ret = param; 63 } 64 return ret; 65 } 66 67 73 public void addListener(InvokerCallbackHandler callbackHandler) 74 { 75 } 76 77 83 public void removeListener(InvokerCallbackHandler callbackHandler) 84 { 85 } 86 } 87 | Popular Tags |