org.jboss.remoting.transporter
Class TransporterServer

java.lang.Object
  extended by org.jboss.remoting.transporter.TransporterServer

public class TransporterServer
extends java.lang.Object

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(org.w3c.dom.Element xmlConfig, java.lang.Object target, java.lang.String subsystem)
          Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.
TransporterServer(InvokerLocator locator, java.lang.Object target, java.lang.String subsystem)
          Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.
TransporterServer(InvokerLocator locator, java.lang.Object target, java.lang.String subsystem, java.util.Map config)
          Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.
 
Method Summary
 void addHandler(java.lang.Object target, java.lang.String proxyclassname)
          Adds a transporter handler to receive remote invocations on the target object passed.
static TransporterServer createTransporterServer(org.w3c.dom.Element xmlconfig, java.lang.Object target, java.lang.String subsystem, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, java.lang.Object target)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, java.lang.Object target, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, java.lang.Object target, java.lang.String subsystem)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, java.lang.Object target, java.lang.String subsystem, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(InvokerLocator locator, java.lang.Object target, java.lang.String subsystem, java.util.Map config, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(java.lang.String locator, java.lang.Object target)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(java.lang.String locator, java.lang.Object target, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(java.lang.String locatorURI, java.lang.Object target, java.lang.String subsystem)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(java.lang.String locatorURI, java.lang.Object target, java.lang.String subsystem, boolean isClustered)
          Creates a remoting server based on given locator.
static TransporterServer createTransporterServer(java.lang.String locatorURI, java.lang.Object target, java.lang.String subsystem, java.util.Map config, boolean isClustered)
          Creates a remoting server based on given locator.
protected  Connector getConnector(InvokerLocator locator, java.util.Map config, org.w3c.dom.Element xmlConfig)
          Returns the connector that this transporter server will use.
 void start()
          Starts the remoting server.
 void stop()
          Stops the remoting server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransporterServer

public TransporterServer(InvokerLocator locator,
                         java.lang.Object target,
                         java.lang.String subsystem)
                  throws java.lang.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:
java.lang.Exception

TransporterServer

public TransporterServer(org.w3c.dom.Element xmlConfig,
                         java.lang.Object target,
                         java.lang.String subsystem)
                  throws java.lang.Exception
Creates a remoting server using the provided locator and subsytem and creating a TransporterHandler which takes the specified target object.

Parameters:
xmlConfig -
target -
subsystem -
Throws:
java.lang.Exception

TransporterServer

public TransporterServer(InvokerLocator locator,
                         java.lang.Object target,
                         java.lang.String subsystem,
                         java.util.Map config)
                  throws java.lang.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 -
config - - configuration data for Connector
Throws:
java.lang.Exception
Method Detail

getConnector

protected Connector getConnector(InvokerLocator locator,
                                 java.util.Map config,
                                 org.w3c.dom.Element xmlConfig)
                          throws java.lang.Exception
Returns the connector that this transporter server will use. Subclasses are free to override this method in order to create a more customized connector.

Parameters:
locator -
config - configuration data for connector
xmlConfig - configuration data for connector (in xml form)
Returns:
the connector to be used by this transporter server
Throws:
java.lang.Exception

addHandler

public void addHandler(java.lang.Object target,
                       java.lang.String proxyclassname)
                throws java.lang.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:
java.lang.Exception

start

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

Throws:
java.lang.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,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem,
                                                        java.util.Map config,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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.
config - - the configuration to be used in setting up the Connector.
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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(java.lang.String locatorURI,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(java.lang.String locatorURI,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem,
                                                        java.util.Map config,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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.
config - - the configuration data for the Connector.
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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(org.w3c.dom.Element xmlconfig,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object. Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

Parameters:
xmlconfig - - specifies config for Connector
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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        java.lang.Object target)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(InvokerLocator locator,
                                                        java.lang.Object target,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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.
isClustered - - indicates if want automatic failover on calls to remote servers.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(java.lang.String locator,
                                                        java.lang.Object target)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(java.lang.String locator,
                                                        java.lang.Object target,
                                                        boolean isClustered)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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.
isClustered - - indicates if want automatic failover on calls to remote servers.
Returns:
TransporterServer. Note, it will already be started upon return.
Throws:
java.lang.Exception

createTransporterServer

public static TransporterServer createTransporterServer(java.lang.String locatorURI,
                                                        java.lang.Object target,
                                                        java.lang.String subsystem)
                                                 throws java.lang.Exception
Creates a remoting server based on given locator. Will convert any remote invocation requests into method calls on the given target object.Note: the TransporterServer instance returned will be a live (started) instance. Once the TransporterServer has been returned, it will have already been started automatically, so is a live server ready to receive requests.

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:
java.lang.Exception


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