KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > ClientInterceptor


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 java.util.List JavaDoc;
12
13 /**
14  * Client is a convience method for invoking remote methods for a given subsystem
15  *
16  * @author <a HREF="mailto:jhaynie@vocalocity.net">Jeff Haynie</a>
17  * @author <a HREF="mailto:telrod@e2technologies.net">Tom Elrod</a>
18  * @version $Revision: 1.2.14.2 $
19  */

20 public interface ClientInterceptor
21 {
22
23    boolean isConnected (InvokerLocator locator) throws Exception JavaDoc;
24
25    void connect (InvokerLocator locator) throws Exception JavaDoc;
26
27    void disconnect (InvokerLocator locator) throws Exception JavaDoc;
28
29
30     /**
31      * invoke the method remotely
32      *
33      * @param sessionId
34      * @param method
35      * @param params
36      * @param signature
37      * @param sendPayload
38      * @return
39      * @throws Throwable
40      */

41     Object JavaDoc invoke (InvocationRequest invocation)
42       throws Throwable JavaDoc;
43
44     /**
45      * If the client invoker has a client locator, call it to add the client's
46      * callback handler. Then call the server to add a callback handler
47      * (regardless of client locator being null). This will allow for pull or
48      * push callbacks.
49      * @param callbackHandler
50      * @throws Throwable
51      */

52     void addListener(InvokerLocator locator, String JavaDoc sessionId, InvokerCallbackHandler callbackHandler) throws Throwable JavaDoc;
53
54     /**
55      * Removes callback handler as a callback listener from the server (and client in
56      * the case that it was setup to receive async callbacks). See addListener().
57      * @param callbackHandler
58      * @throws Throwable
59      */

60     void removeListener(InvokerLocator locator, String JavaDoc sessionId, InvokerCallbackHandler callbackHandler) throws Throwable JavaDoc;
61
62     List JavaDoc getCallbacks(InvokerLocator locator, String JavaDoc sessionId) throws Throwable JavaDoc;
63
64 }
65
Popular Tags