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.
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.
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.
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.
23
package org.jboss.remoting.transport;
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;
33
import javax.net.SocketFactory;
35
import java.util.List;
38
* Interface to be used for calling on all the different invoker types (LocalClientInvoker
39
* and RemoteClientInvoker).
41
* @author <a href="mailto:telrod@e2technologies.net">Tom Elrod</a>
42
* @author <a href="mailto:ovidiu@jboss.org">Ovidiu Feodorov</a>
44
public interface ClientInvoker extends Invoker
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.
52
* @return id for callback handler and locator combination.
54
String addClientLocator(String sessionId,
55
InvokerCallbackHandler callbackhandler,
56
InvokerLocator locator);
59
* Gets the client locator. This locator will be used by the server side
60
* to make callbacks to the handler for this locator.
62
InvokerLocator getClientLocator(String listenerId);
65
* Gets list of AbstractInvoker.CallbackLocatorHolder containing listener id and locator
67
List getClientLocators(String sessionId, InvokerCallbackHandler handler);
70
* Gets SocketFactory used to connect to ServerInvoker.
72
SocketFactory getSocketFactory();
75
* Sets the SocketFactory that will be used to connect to ServerInvoker.
77
* @param socketFactory
79
void setSocketFactory(SocketFactory socketFactory);
82
* Transport a request against a remote ServerInvoker.
84
Object invoke(InvocationRequest in) throws Throwable;
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).
92
* @return boolean true if connected, false if not.
94
boolean isConnected();
97
* Connect to the remote invoker.
99
void connect() throws ConnectionFailedException;
102
* Disconnect from the remote invokere.
106
void setMarshaller(Marshaller marshaller);
108
Marshaller getMarshaller();
110
void setUnMarshaller(UnMarshaller unmarshaller);
112
UnMarshaller getUnMarshaller();
114
void establishLease(String sessionID, Map configuration, long leasePeriod) throws Throwable;
117
* Must behave as a noop if there's no active lease.
119
void terminateLease(String sessionID, int disconnectTimeout);
122
* @return the lease period (in ms) if the client has an active leasing mechanism with the server
125
long getLeasePeriod(String sessionID);
b'\\ No newline at end of file'