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