KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > handler > mbean > MBeanHandler


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
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 JavaDoc;
15
16 /**
17  * @author <a HREF="mailto:tom.elrod@jboss.com">Tom Elrod</a>
18  */

19 public class MBeanHandler extends ServiceMBeanSupport implements MBeanHandlerMBean
20 {
21    private MBeanServer JavaDoc server = null;
22    private ServerInvoker invoker = null;
23
24    /**
25     * set the mbean server that the handler can reference
26     *
27     * @param server
28     */

29    public void setMBeanServer(MBeanServer JavaDoc server)
30    {
31       this.server = server;
32    }
33
34    /**
35     * set the invoker that owns this handler
36     *
37     * @param invoker
38     */

39    public void setInvoker(ServerInvoker invoker)
40    {
41       this.invoker = invoker;
42    }
43
44    /**
45     * called to handle a specific invocation
46     *
47     * @param invocation
48     * @return
49     * @throws Throwable
50     */

51    public Object JavaDoc invoke(InvocationRequest invocation) throws Throwable JavaDoc
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 from
59     * the server invoker handler.
60     *
61     * @param callbackHandler
62     */

63    public void addListener(InvokerCallbackHandler callbackHandler)
64    {
65       // NO OP for test
66
}
67
68    /**
69     * Removes the callback handler that was listening for callbacks
70     * from the server invoker handler.
71     *
72     * @param callbackHandler
73     */

74    public void removeListener(InvokerCallbackHandler callbackHandler)
75    {
76       // NO OP for test
77
}
78 }
Popular Tags