com.createtank.elemenope.transports
Class XmlRpcEnterpriseConnector

java.lang.Object
  extended by com.createtank.elemenope.transports.XmlRpcEnterpriseConnector
All Implemented Interfaces:
Connector, ElemenopeComponent, ElemenopeConnectionEntity

public class XmlRpcEnterpriseConnector
extends java.lang.Object
implements Connector

Enterprise XML-RPC implementation of the elemenope Connector interface.

Implements multithreaded listeners via embedded Jetty HTTP Server for enterprise level XML-RPC brokering (receipt) capability.

This Connector implementation is compatible with the XmlRpcEnterpriseBroker Broker implementation.

This Connector implementation must be configured with the following attributes:

class
Fully Qualified Class Name
e.g. com.createtank.elemenope.transports.XmlRpcEnterpriseConnector
host
hostname for service HTTP listener
required: no
default: localhost
port
port for service HTTP listener
required: YES
default: none
minThreads
minimum number of threads for embedded Jetty HTTP server
required: no
default: 1
maxThreads
maximum number of threads for embedded Jetty HTTP server
required: no
default: 10
maxIdleTime
number of milliseconds for embedded Jetty HTTP server listener to wait before closing and restarting listener
required: no
default: 60000 (60 seconds)

For an example configuration, see the elemenope userguide

Author:
John Joseph Roets [mailto:john.roets@createtank.com]

Constructor Summary
XmlRpcEnterpriseConnector()
           
 
Method Summary
 void connect()
          makes initial connection to entity
 void disconnect()
          closes connection to entity
 java.lang.Object getConnection()
          Get connection implementation specific object.
 java.util.Map getConnectionAttributes()
          gets connectivity attributes
 boolean isActive()
          May be used by DispatcherFailover [DFO] implementations to ascertain whether a connection is currently viable.
 void registerBroker(XmlRpcEnterpriseBroker broker, java.lang.String webServiceName)
           Register an XmlRpcEnterpriseBroker with the Connector (Jetty Handler)
 void releaseComponents()
          Should be called upon shutdown, in order for elemenope component classes clean up after themselves.
 void setComponents(ElemenopeComponents components)
          Passes all configured components to implementing Object.
 void setConfigurationAttributes(java.util.Map atts)
          sets configuration attributes
 void setConnectionAttributes(java.util.Map atts)
          sets connectivity attributes
 void start()
          starts the connection to entity
 void stop()
          stops the connection to entity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcEnterpriseConnector

public XmlRpcEnterpriseConnector()
Method Detail

setComponents

public void setComponents(ElemenopeComponents components)
Description copied from interface: ElemenopeComponent
Passes all configured components to implementing Object.

Should ususally be called at the end of the initialization cycle, when all components have been instantiated.

Specified by:
setComponents in interface ElemenopeComponent

setConnectionAttributes

public void setConnectionAttributes(java.util.Map atts)
                             throws ElemenopeException
Description copied from interface: ElemenopeConnectionEntity
sets connectivity attributes

Specified by:
setConnectionAttributes in interface ElemenopeConnectionEntity
Parameters:
atts - Map of connectivity attributes
Throws:
ElemenopeException

connect

public void connect()
             throws ElemenopeConnectionException
Description copied from interface: Connector
makes initial connection to entity

Specified by:
connect in interface Connector
Throws:
ElemenopeConnectionException

start

public void start()
           throws ElemenopeConnectionException
Description copied from interface: Connector
starts the connection to entity

Specified by:
start in interface Connector
Throws:
ElemenopeConnectionException

disconnect

public void disconnect()
                throws ElemenopeConnectionException
Description copied from interface: Connector
closes connection to entity

Specified by:
disconnect in interface Connector
Throws:
ElemenopeConnectionException

stop

public void stop()
Description copied from interface: Connector
stops the connection to entity

Specified by:
stop in interface Connector

getConnectionAttributes

public java.util.Map getConnectionAttributes()
                                      throws ElemenopeException
Description copied from interface: ElemenopeConnectionEntity
gets connectivity attributes

Specified by:
getConnectionAttributes in interface ElemenopeConnectionEntity
Returns:
connectivity attributes
Throws:
ElemenopeException

getConnection

public java.lang.Object getConnection()
                               throws ElemenopeException
Description copied from interface: Connector
Get connection implementation specific object.

Used by some implementations to pass connection for use by Broker or Dispatcher.

Specified by:
getConnection in interface Connector
Returns:
connection implementation specific object.
Throws:
ElemenopeException

isActive

public boolean isActive()
Description copied from interface: Connector
May be used by DispatcherFailover [DFO] implementations to ascertain whether a connection is currently viable.

Specified by:
isActive in interface Connector
Returns:
Is connection active?

releaseComponents

public void releaseComponents()
Description copied from interface: ElemenopeComponent
Should be called upon shutdown, in order for elemenope component classes clean up after themselves.

Specified by:
releaseComponents in interface ElemenopeComponent

setConfigurationAttributes

public void setConfigurationAttributes(java.util.Map atts)
                                throws ElemenopeException
Description copied from interface: ElemenopeComponent
sets configuration attributes

Specified by:
setConfigurationAttributes in interface ElemenopeComponent
Parameters:
atts - Map of connectivity attributes
Throws:
ElemenopeException

registerBroker

public void registerBroker(XmlRpcEnterpriseBroker broker,
                           java.lang.String webServiceName)

Register an XmlRpcEnterpriseBroker with the Connector (Jetty Handler)

This method is called by the XML-RPC Enterprise Broker implementation from each Broker configured.

Parameters:
broker - XmlRpcEnterpriseBroker instance to register
webServiceName - XML-RPC web service name under which the Broker should be registered