Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.remoting.transporter
Class TransporterClient

java.lang.Object
  extended by org.nuxeo.runtime.remoting.transporter.TransporterClient
All Implemented Interfaces:
Serializable, InvocationHandler

public class TransporterClient
extends Object
implements InvocationHandler, Serializable

Class to be used as a factory via static method calls to get remote proxy to POJO that exists within a external process. Note, if using clustered, will use the multicast detector by default.

bs@nuxeo.com - Fixed bugs related to client subsystem initialization

Author:
Tom Elrod
See Also:
Serialized Form

Method Summary
static Object createTransporterClient(InvokerLocator locator, Class targetClass)
          Creates a remote proxy to a POJO on a remote server.
static Object createTransporterClient(String locatorURI, Class targetClass)
          Creates a remote proxy to a POJO on a remote server.
static Object createTransporterClient(String locatorURI, Class targetClass, boolean clustered)
          Creates a remote proxy to a POJO on a remote server.
static void destroyTransporterClient(Object transporterClient)
          Needs to be called by user when no longer need to make calls on remote POJO.
 Object invoke(Object proxy, Method method, Object[] args)
          The method called when anyone calls on the dynamic proxy returned by getProcessor().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTransporterClient

public static Object createTransporterClient(String locatorURI,
                                             Class targetClass,
                                             boolean clustered)
                                      throws Exception
Creates a remote proxy to a POJO on a remote server.

Parameters:
locatorURI - the remoting locator URI to the target server where the target POJO exists.
targetClass - the interface class of the POJO will be calling upon.
clustered - true will cause the transporter to look for other remoting serves that have the POJO running and include it in the client's target list. If a call on first target fails, will seamlessly failover to one of the other discovered targets.
Returns:
dynamic remote proxy typed to the interface specified by the targetClass param
Throws:
Exception

createTransporterClient

public static Object createTransporterClient(String locatorURI,
                                             Class targetClass)
                                      throws Exception
Creates a remote proxy to a POJO on a remote server.

Parameters:
locatorURI - the remoting locator URI to the target server where the target POJO exists
targetClass - the interface class of the POJO will be calling upon.
Returns:
dynamic remote proxy typed to the interface specified by the targetClass parameter
Throws:
Exception

createTransporterClient

public static Object createTransporterClient(InvokerLocator locator,
                                             Class targetClass)
                                      throws Exception
Creates a remote proxy to a POJO on a remote server.

Parameters:
locator - the remoting locator to the target server where the target POJO exists
targetClass - the interface class of the POJO will be calling upon.
Returns:
dynamic remote proxy typed to the interface specified by the targetClass parameter
Throws:
Exception

destroyTransporterClient

public static void destroyTransporterClient(Object transporterClient)
Needs to be called by user when no longer need to make calls on remote POJO. Otherwise will maintain remote connection until this is called.


invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
The method called when anyone calls on the dynamic proxy returned by getProcessor(). This method will simply convert the proxy call info into a remoting invocation on the target remoting server (using a NameBaseInvocation).

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.