KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > remoting > transport > ClientInvoker


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.transport;
8
9 import org.jboss.remoting.ConnectionFailedException;
10 import org.jboss.remoting.InvocationRequest;
11 import org.jboss.remoting.Invoker;
12 import org.jboss.remoting.InvokerLocator;
13 import org.jboss.remoting.marshal.Marshaller;
14 import org.jboss.remoting.marshal.UnMarshaller;
15
16 /**
17  * Interface to be used for calling on all the different invoker types (LocalClientInvoker
18  * and RemoteClientInvoker).
19  *
20  * @author <a HREF="mailto:telrod@e2technologies.net">Tom Elrod</a>
21  */

22 public interface ClientInvoker extends Invoker
23 {
24    /**
25     * This should be set when want to override the default behavior of automatically
26     * getting s suitable locator. This should be used want want to control what type
27     * of callbacks to receive (pull or push). Set to null to poll for callback messages.
28     * This can also be used to receive callbacks using another transport and subsystem,
29     * if desired.
30     *
31     * @param locator
32     */

33    public void addClientLocator(String JavaDoc listenerId, InvokerLocator locator);
34
35    /**
36     * Gets the client locator. This locator will be used by the server side
37     * to make callbacks to the handler for this locator.
38     *
39     * @return
40     */

41    public InvokerLocator getClientLocator(String JavaDoc listenerId);
42
43    /**
44     * transport a request against a remote ServerInvoker
45     *
46     * @param in
47     * @return
48     * @throws Throwable
49     */

50    public Object JavaDoc invoke(InvocationRequest in) throws Throwable JavaDoc;
51
52    /**
53     * subclasses must provide this method to return true if their remote connection is connected and
54     * false if disconnected. in some transports, such as SOAP, this method may always return true, since the
55     * remote connectivity is done on demand and not kept persistent like other transports (such as socket-based
56     * transport).
57     *
58     * @return boolean true if connected, false if not
59     */

60    public boolean isConnected();
61
62    /**
63     * connect to the remote invoker
64     *
65     * @throws org.jboss.remoting.ConnectionFailedException
66     *
67     */

68    public void connect() throws ConnectionFailedException;
69
70    /**
71     * disconnect from the remote invokere
72     */

73    public void disconnect();
74
75    public void setMarshaller(Marshaller marshaller);
76
77    public Marshaller getMarshaller();
78
79    public void setUnMarshaller(UnMarshaller unmarshaller);
80
81    public UnMarshaller getUnMarshaller();
82 }
Popular Tags