Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.remoting.transporter
Class TransporterServer

java.lang.Object
  extended by org.nuxeo.runtime.remoting.transporter.TransporterServer

public class TransporterServer
extends Object

Modified to be compatible with 2.0.0.GA - added addHandler() method - as in JBossRemoting 2.0.0.GA The remoting server to expose the target POJO. This should be called on as a factory via static methods.

Author:
Tom Elrod

Constructor Summary
TransporterServer(InvokerLocator locator, Object target, String subsystem)
          Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.
 
Method Summary
 void addHandler(Object target, String proxyclassname)
          Adds a transporter handler to receive remote invocations on the target object passed.
static TransporterServer createTransporterServer(InvokerLocator locator, Object target)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, Object target, String subsystem)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, Object target, String subsystem, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(String locatorURI, Object target)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(String locatorURI, Object target, String subsystem)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(String locatorURI, Object target, String subsystem, boolean isClustered)
          Creates a remoting server based on given locator.
 Connector getConnector()
           
 String getLocatorURI()
           
 void start()
          Starts the remoting server.
 void stop()
          Stops the remoting server.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransporterServer

public TransporterServer(InvokerLocator locator,
                         Object target,
                         String subsystem)
                  throws Exception
Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.

Parameters:
locator -
target -
subsystem -
Throws:
Exception
Method Detail

getConnector

public Connector getConnector()

addHandler

public void addHandler(Object target,
                       String proxyclassname)
                throws Exception
Adds a transporter handler to receive remote invocations on the target object passed.

Parameters:
target - the target implementation to call on
proxyclassname - the fully qualified classname of the interface that clients will use to call on
Throws:
Exception

getLocatorURI

public String getLocatorURI()

start

public void start()
           throws Exception
Starts the remoting server. This is called automatically upon any of the static createTransporterServer() methods.

Throws:
Exception

stop

public void stop()
Stops the remoting server. This must be called when no longer want to expose the target POJO for remote method calls.


createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        Object target,
                                                        String subsystem,
                                                        boolean isClustered)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locator - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
subsystem - - the name under which to register the handler within the remoting server. This must be the fully qualified name of the interface for clients to use a the remote proxy to the target POJO. Otherwise, clustering will not work, as this is the value used to identifiy remote POJOs on the client side. If not clustered, this is not as critical, and simply use the fully qualified class name of the POJO if desired.
isClustered - - true indicates that would like this server to be considered available for failover from clients calling on the same interface as exposed by the subsystem value. False will only allow those client that explicitly targeting this server to make calls on it.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

createTransporterServer

public static TransporterServer createTransporterServer(String locatorURI,
                                                        Object target,
                                                        String subsystem,
                                                        boolean isClustered)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locatorURI - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
subsystem - - the name under which to register the handler within the remoting server. This must be the fully qualified name of the interface for clients to use a the remote proxy to the target POJO. Otherwise, clustering will not work, as this is the value used to identifiy remote POJOs on the client side. If not clustered, this is not as critical, and simply use the fully qualified class name of the POJO if desired.
isClustered - - true indicates that would like this server to be considered available for failover from clients calling on the same interface as exposed by the subsystem value. False will only allow those client that explicitly targeting this server to make calls on it.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        Object target,
                                                        String subsystem)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locator - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
subsystem - - the name under which to register the handler within the remoting server. Can simply use the fully qualified class name of the POJO if desired.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

createTransporterServer

public static TransporterServer createTransporterServer(String locatorURI,
                                                        Object target,
                                                        String subsystem)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locatorURI - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
subsystem - - the name under which to register the handler within the remoting server. Can simply use the fully qualified class name of the POJO if desired.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        Object target)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locator - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

createTransporterServer

public static TransporterServer createTransporterServer(String locatorURI,
                                                        Object target)
                                                 throws Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.

Parameters:
locatorURI - - specifies what transport, host and port binding, etc. to use by the remoting server.
target - - the target POJO to receive the method call upon getting remote invocation requests.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
Exception

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.