org.jboss.remoting.transport
Interface ClientInvoker

All Superinterfaces:
Invoker
All Known Subinterfaces:
BidirectionalClientInvoker
All Known Implementing Classes:
BisocketClientInvoker, HTTPClientInvoker, HTTPSClientInvoker, LocalClientInvoker, MicroRemoteClientInvoker, MicroSocketClientInvoker, MultiplexClientInvoker, RemoteClientInvoker, RMIClientInvoker, SocketClientInvoker, SSLBisocketClientInvoker, SSLMultiplexClientInvoker, SSLRMIClientInvoker, SSLSocketClientInvoker

public interface ClientInvoker
extends Invoker

Interface to be used for calling on all the different invoker types (LocalClientInvoker and RemoteClientInvoker).

Author:
Tom Elrod, Ovidiu Feodorov

Method Summary
 java.lang.String addClientLocator(java.lang.String sessionId, InvokerCallbackHandler callbackhandler, InvokerLocator locator)
          This should be set when want to override the default behavior of automatically getting a suitable locator.
 void connect()
          Connect to the remote invoker.
 void disconnect()
          Disconnect from the remote invokere.
 void establishLease(java.lang.String sessionID, java.util.Map configuration, long leasePeriod)
           
 InvokerLocator getClientLocator(java.lang.String listenerId)
          Gets the client locator.
 java.util.List getClientLocators(java.lang.String sessionId, InvokerCallbackHandler handler)
          Gets list of AbstractInvoker.CallbackLocatorHolder containing listener id and locator
 long getLeasePeriod(java.lang.String sessionID)
           
 Marshaller getMarshaller()
           
 javax.net.SocketFactory getSocketFactory()
          Gets SocketFactory used to connect to ServerInvoker.
 UnMarshaller getUnMarshaller()
           
 java.lang.Object invoke(InvocationRequest in)
          Transport a request against a remote ServerInvoker.
 boolean isConnected()
          Subclasses must provide this method to return true if their remote connection is connected and false if disconnected.
 void setMarshaller(Marshaller marshaller)
           
 void setSocketFactory(javax.net.SocketFactory socketFactory)
          Sets the SocketFactory that will be used to connect to ServerInvoker.
 void setUnMarshaller(UnMarshaller unmarshaller)
           
 void terminateLease(java.lang.String sessionID, int disconnectTimeout)
          Must behave as a noop if there's no active lease.
 
Methods inherited from interface org.jboss.remoting.Invoker
getLocator
 

Method Detail

addClientLocator

java.lang.String addClientLocator(java.lang.String sessionId,
                                  InvokerCallbackHandler callbackhandler,
                                  InvokerLocator locator)
This should be set when want to override the default behavior of automatically getting a suitable locator. This should be used want want to control what type of callbacks to receive (pull or push). Set to null to poll for callback messages. This can also be used to receive callbacks using another transport and subsystem, if desired.

Returns:
id for callback handler and locator combination.

getClientLocator

InvokerLocator getClientLocator(java.lang.String listenerId)
Gets the client locator. This locator will be used by the server side to make callbacks to the handler for this locator.


getClientLocators

java.util.List getClientLocators(java.lang.String sessionId,
                                 InvokerCallbackHandler handler)
Gets list of AbstractInvoker.CallbackLocatorHolder containing listener id and locator


getSocketFactory

javax.net.SocketFactory getSocketFactory()
Gets SocketFactory used to connect to ServerInvoker.


setSocketFactory

void setSocketFactory(javax.net.SocketFactory socketFactory)
Sets the SocketFactory that will be used to connect to ServerInvoker.

Parameters:
socketFactory -

invoke

java.lang.Object invoke(InvocationRequest in)
                        throws java.lang.Throwable
Transport a request against a remote ServerInvoker.

Throws:
java.lang.Throwable

isConnected

boolean isConnected()
Subclasses must provide this method to return true if their remote connection is connected and false if disconnected. In some transports, such as SOAP, this method may always return true, since the remote connectivity is done on demand and not kept persistent like other transports (such as socket-based transport).

Returns:
boolean true if connected, false if not.

connect

void connect()
             throws ConnectionFailedException
Connect to the remote invoker.

Throws:
ConnectionFailedException

disconnect

void disconnect()
Disconnect from the remote invokere.


setMarshaller

void setMarshaller(Marshaller marshaller)

getMarshaller

Marshaller getMarshaller()

setUnMarshaller

void setUnMarshaller(UnMarshaller unmarshaller)

getUnMarshaller

UnMarshaller getUnMarshaller()

establishLease

void establishLease(java.lang.String sessionID,
                    java.util.Map configuration,
                    long leasePeriod)
                    throws java.lang.Throwable
Throws:
java.lang.Throwable

terminateLease

void terminateLease(java.lang.String sessionID,
                    int disconnectTimeout)
Must behave as a noop if there's no active lease.


getLeasePeriod

long getLeasePeriod(java.lang.String sessionID)
Returns:
the lease period (in ms) if the client has an active leasing mechanism with the server or -1 otherwise.


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.