KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > remoting > EJB3RemotingInvocationHandler


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.ejb3.remoting;
10
11 import org.jboss.remoting.InvocationRequest;
12 import org.jboss.remoting.InvokerCallbackHandler;
13 import org.jboss.remoting.ServerInvocationHandler;
14 import org.jboss.remoting.ServerInvoker;
15
16 import javax.management.MBeanServer JavaDoc;
17
18 /**
19  * AOPRemotingInvocationHandler is a ServerInvocationHandler that will forward requests to the
20  * aop Dispatcher
21  *
22  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
23  * @version $Revision: 1.2.2.2 $
24  */

25 public class EJB3RemotingInvocationHandler implements ServerInvocationHandler
26 {
27    private ServerInvoker invoker;
28    private MBeanServer JavaDoc server;
29
30    public EJB3RemotingInvocationHandler()
31    {
32       super();
33    }
34
35    /**
36     * set the invoker that owns this handler
37     *
38     * @param invoker
39     */

40    public void setInvoker(ServerInvoker invoker)
41    {
42       this.invoker = invoker;
43    }
44
45    /**
46     * set the mbean server that the handler can reference
47     *
48     * @param server
49     */

50    public void setMBeanServer(MBeanServer JavaDoc server)
51    {
52       this.server = server;
53    }
54
55    /**
56     * method is called to destroy the handler and remove all pending notifications and listeners
57     * from the notification cache
58     */

59    public synchronized void destroy()
60    {
61    }
62
63    protected void finalize() throws Throwable JavaDoc
64    {
65       destroy();
66       super.finalize();
67    }
68
69    public Object JavaDoc invoke(InvocationRequest invocation)
70    throws Throwable JavaDoc
71    {
72       /*
73       EJBRemoteInvocation inv =(EJBRemoteInvocation)invocation.getParameter();
74       Container container = (Container)Registry.lookup(inv.getContainerId());
75       return container.remoteInvoke(inv);
76       */

77       throw new RuntimeException JavaDoc("ABORT NOT USED ANYMORE");
78    }
79
80    /**
81     * Adds a callback handler that will listen for callbacks from
82     * the server invoker handler.
83     *
84     * @param callbackHandler
85     */

86    public void addListener(InvokerCallbackHandler callbackHandler)
87    {
88       //TODO: implement for callback api -TME
89
}
90
91    /**
92     * Removes the callback handler that was listening for callbacks
93     * from the server invoker handler.
94     *
95     * @param callbackHandler
96     */

97    public void removeListener(InvokerCallbackHandler callbackHandler)
98    {
99       //TODO: implement for callback api -TME
100
}
101 }
102
Popular Tags