~ubuntu-branches/ubuntu/raring/libjboss-remoting-java/raring

« back to all changes in this revision

Viewing changes to src/org/jboss/remoting/transport/ClientInvoker.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-09 14:01:03 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: package-import@ubuntu.com-20110909140103-o8ucrolqt5g25k57
Tags: upstream-2.5.3.SP1
ImportĀ upstreamĀ versionĀ 2.5.3.SP1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
* JBoss, Home of Professional Open Source
3
 
* Copyright 2005, JBoss Inc., and individual contributors as indicated
4
 
* by the @authors tag. See the copyright.txt in the distribution for a
5
 
* full listing of individual contributors.
6
 
*
7
 
* This is free software; you can redistribute it and/or modify it
8
 
* under the terms of the GNU Lesser General Public License as
9
 
* published by the Free Software Foundation; either version 2.1 of
10
 
* the License, or (at your option) any later version.
11
 
*
12
 
* This software is distributed in the hope that it will be useful,
13
 
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
 
* Lesser General Public License for more details.
16
 
*
17
 
* You should have received a copy of the GNU Lesser General Public
18
 
* License along with this software; if not, write to the Free
19
 
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
 
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21
 
*/
22
 
 
23
 
package org.jboss.remoting.transport;
24
 
 
25
 
import org.jboss.remoting.ConnectionFailedException;
26
 
import org.jboss.remoting.InvocationRequest;
27
 
import org.jboss.remoting.Invoker;
28
 
import org.jboss.remoting.InvokerLocator;
29
 
import org.jboss.remoting.callback.InvokerCallbackHandler;
30
 
import org.jboss.remoting.marshal.Marshaller;
31
 
import org.jboss.remoting.marshal.UnMarshaller;
32
 
 
33
 
import javax.net.SocketFactory;
34
 
import java.util.Map;
35
 
import java.util.List;
36
 
 
37
 
/**
38
 
 * Interface to be used for calling on all the different invoker types (LocalClientInvoker
39
 
 * and RemoteClientInvoker).
40
 
 *
41
 
 * @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
42
 
 * @author <a href="mailto:ovidiu@jboss.org">Ovidiu Feodorov</a>
43
 
 */
44
 
public interface ClientInvoker extends Invoker
45
 
{
46
 
   /**
47
 
    * This should be set when want to override the default behavior of automatically getting a
48
 
    * suitable locator. This should be used want want to control what type of callbacks to receive
49
 
    * (pull or push).  Set to null to poll for callback messages. This can also be used to receive
50
 
    * callbacks using another transport and subsystem, if desired.
51
 
    *
52
 
    * @return id for callback handler and locator combination.
53
 
    */
54
 
   String addClientLocator(String sessionId,
55
 
                           InvokerCallbackHandler callbackhandler,
56
 
                           InvokerLocator locator);
57
 
 
58
 
   /**
59
 
    * Gets the client locator.  This locator will be used by the server side
60
 
    * to make callbacks to the handler for this locator.
61
 
    */
62
 
   InvokerLocator getClientLocator(String listenerId);
63
 
 
64
 
   /**
65
 
    * Gets list of AbstractInvoker.CallbackLocatorHolder containing listener id and locator
66
 
    */
67
 
   List getClientLocators(String sessionId, InvokerCallbackHandler handler);
68
 
 
69
 
   /**
70
 
    * Gets SocketFactory used to connect to ServerInvoker.
71
 
    */
72
 
   SocketFactory getSocketFactory();
73
 
 
74
 
   /**
75
 
    * Sets the SocketFactory that will be used to connect to ServerInvoker.
76
 
    *
77
 
    * @param socketFactory
78
 
    */
79
 
   void setSocketFactory(SocketFactory socketFactory);
80
 
 
81
 
   /**
82
 
    * Transport a request against a remote ServerInvoker.
83
 
    */
84
 
   Object invoke(InvocationRequest in) throws Throwable;
85
 
 
86
 
   /**
87
 
    * Subclasses must provide this method to return true if their remote connection is connected and
88
 
    * false if disconnected.  In some transports, such as SOAP, this method may always return true,
89
 
    * since the remote connectivity is done on demand and not kept persistent like other transports
90
 
    * (such as socket-based transport).
91
 
    *
92
 
    * @return boolean true if connected, false if not.
93
 
    */
94
 
   boolean isConnected();
95
 
 
96
 
   /**
97
 
    * Connect to the remote invoker.
98
 
    */
99
 
   void connect() throws ConnectionFailedException;
100
 
 
101
 
   /**
102
 
    * Disconnect from the remote invokere.
103
 
    */
104
 
   void disconnect();
105
 
 
106
 
   void setMarshaller(Marshaller marshaller);
107
 
 
108
 
   Marshaller getMarshaller();
109
 
 
110
 
   void setUnMarshaller(UnMarshaller unmarshaller);
111
 
 
112
 
   UnMarshaller getUnMarshaller();
113
 
 
114
 
   void establishLease(String sessionID, Map configuration, long leasePeriod) throws Throwable;
115
 
 
116
 
   /**
117
 
    * Must behave as a noop if there's no active lease.
118
 
    */
119
 
   void terminateLease(String sessionID, int disconnectTimeout);
120
 
 
121
 
   /**
122
 
    * @return the lease period (in ms) if the client has an active leasing mechanism with the server
123
 
    *         or -1 otherwise.
124
 
    */
125
 
   long getLeasePeriod(String sessionID);
126
 
 
127
 
}
 
 
b'\\ No newline at end of file'