1 /*2 * JBoss, the OpenSource J2EE webOS3 *4 * Distributable under LGPL license.5 * See terms of license at gnu.org.6 */7 package org.jboss.remoting.handler.mbean;8 9 import org.jboss.remoting.InvocationRequest;10 import org.jboss.remoting.InvokerCallbackHandler;11 import org.jboss.remoting.ServerInvoker;12 import org.jboss.system.ServiceMBeanSupport;13 14 import javax.management.MBeanServer ;15 16 /**17 * @author <a HREF="mailto:tom.elrod@jboss.com">Tom Elrod</a>18 */19 public class MBeanHandler extends ServiceMBeanSupport implements MBeanHandlerMBean20 {21 private MBeanServer server = null;22 private ServerInvoker invoker = null;23 24 /**25 * set the mbean server that the handler can reference26 *27 * @param server28 */29 public void setMBeanServer(MBeanServer server)30 {31 this.server = server;32 }33 34 /**35 * set the invoker that owns this handler36 *37 * @param invoker38 */39 public void setInvoker(ServerInvoker invoker)40 {41 this.invoker = invoker;42 }43 44 /**45 * called to handle a specific invocation46 *47 * @param invocation48 * @return49 * @throws Throwable50 */51 public Object invoke(InvocationRequest invocation) throws Throwable 52 {53 System.out.println(invocation.getParameter());54 return ServerTest.RESPONSE_VALUE;55 }56 57 /**58 * Adds a callback handler that will listen for callbacks from59 * the server invoker handler.60 *61 * @param callbackHandler62 */63 public void addListener(InvokerCallbackHandler callbackHandler)64 {65 // NO OP for test66 }67 68 /**69 * Removes the callback handler that was listening for callbacks70 * from the server invoker handler.71 *72 * @param callbackHandler73 */74 public void removeListener(InvokerCallbackHandler callbackHandler)75 {76 // NO OP for test77 }78 }