1 /*************************************** 2 * * 3 * JBoss: The OpenSource J2EE WebOS * 4 * * 5 * Distributable under LGPL license. * 6 * See terms of license at gnu.org. * 7 * * 8 ***************************************/ 9 package org.jboss.remoting; 10 11 import javax.management.MBeanServer; 12 import org.jboss.remoting.callback.InvokerCallbackHandler; 13 14 15 /** 16 * ServerInvocationHandler is the server side (remote) end handler which is registered for a given 17 * ServerInvoker implementation. The ServerInvocationHandler does the actual implementation work 18 * of invoking the method on the target object in the remote VM. The ServerInvoker will then 19 * handle marshalling and returning the results via the appropriate transport back to the client invoker. 20 * 21 * @author <a HREF="mailto:jhaynie@vocalocity.net">Jeff Haynie</a> 22 * @author <a HREF="mailto:telrod@e2technologies.net">Tom Elrod</a> 23 * @version $Revision: 1.3 $ 24 */ 25 public interface ServerInvocationHandler 26 { 27 /** 28 * set the mbean server that the handler can reference 29 * 30 * @param server 31 */ 32 public void setMBeanServer(MBeanServer server); 33 34 /** 35 * set the invoker that owns this handler 36 * 37 * @param invoker 38 */ 39 public void setInvoker(ServerInvoker invoker); 40 41 /** 42 * called to handle a specific invocation. Please take care to make sure 43 * implementations are thread safe and can, and often will, receive concurrent 44 * calls on this method. 45 * 46 * @param invocation 47 * @return 48 * @throws Throwable 49 */ 50 public Object invoke(InvocationRequest invocation) 51 throws Throwable; 52 53 /** 54 * Adds a callback handler that will listen for callbacks from 55 * the server invoker handler. 56 * 57 * @param callbackHandler 58 */ 59 public void addListener(InvokerCallbackHandler callbackHandler); 60 61 /** 62 * Removes the callback handler that was listening for callbacks 63 * from the server invoker handler. 64 * 65 * @param callbackHandler 66 */ 67 public void removeListener(InvokerCallbackHandler callbackHandler); 68 69 } 70