org.jboss.remoting.transport.local
Class LocalClientInvoker

java.lang.Object
  extended byorg.jboss.remoting.AbstractInvoker
      extended byorg.jboss.remoting.transport.local.LocalClientInvoker
All Implemented Interfaces:
ClientInvoker, Invoker

public class LocalClientInvoker
extends AbstractInvoker
implements ClientInvoker

LocalClientInvoker does not use any transport protocol for invoking the ServerInvoker, instead will make call directly on it locally. This increases performance since no serialization required as well as needed for push callbacks where InvokerCallbackHandler is in same JVM as the callback server.

Version:
$Revision: 1.7 $
Author:
Tom Elrod

Field Summary
 
Fields inherited from class org.jboss.remoting.AbstractInvoker
classbyteloader, localServerLocator, locator, log
 
Constructor Summary
LocalClientInvoker(InvokerLocator locator)
           
 
Method Summary
 void connect()
          connect to the remote invoker
 void disconnect()
          disconnect from the remote invoker.
 Marshaller getMarshaller()
           
 UnMarshaller getUnMarshaller()
           
 Object invoke(InvocationRequest invocation)
          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 setServerInvoker(ServerInvoker svrInvoker)
          This will set the local reference to the server invoker.
 void setUnMarshaller(UnMarshaller unmarshaller)
           
 
Methods inherited from class org.jboss.remoting.AbstractInvoker
getClassLoader, getClientLocator, getLocator, setClassLoader, setClientLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.remoting.transport.ClientInvoker
getClientLocator, setClientLocator
 
Methods inherited from interface org.jboss.remoting.Invoker
getLocator
 

Constructor Detail

LocalClientInvoker

public LocalClientInvoker(InvokerLocator locator)
Method Detail

invoke

public Object invoke(InvocationRequest invocation)
              throws Throwable
transport a request against a remote ServerInvoker

Specified by:
invoke in interface ClientInvoker
Parameters:
invocation -
Returns:
Throws:
Throwable

isConnected

public 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).

Specified by:
isConnected in interface ClientInvoker
Returns:
boolean true if connected, false if not

connect

public void connect()
             throws ConnectionFailedException
connect to the remote invoker

Specified by:
connect in interface ClientInvoker
Throws:
ConnectionFailedException

disconnect

public void disconnect()
disconnect from the remote invoker. Once disconnect called will not be able to re-connect by calling connect since will loose reference to server invoker.

Specified by:
disconnect in interface ClientInvoker

setMarshaller

public void setMarshaller(Marshaller marshaller)
Specified by:
setMarshaller in interface ClientInvoker

getMarshaller

public Marshaller getMarshaller()
Specified by:
getMarshaller in interface ClientInvoker

setUnMarshaller

public void setUnMarshaller(UnMarshaller unmarshaller)
Specified by:
setUnMarshaller in interface ClientInvoker

getUnMarshaller

public UnMarshaller getUnMarshaller()
Specified by:
getUnMarshaller in interface ClientInvoker

setServerInvoker

public void setServerInvoker(ServerInvoker svrInvoker)
This will set the local reference to the server invoker. This is needed to so can make calls directly against server.

Parameters:
svrInvoker -


Copyright © 2004 JBoss Inc. All Rights Reserved.