com.createtank.elemenope.transports
Class XmlRpcEnterpriseBroker

java.lang.Object
  extended by com.createtank.elemenope.transports.XmlRpcEnterpriseBroker
All Implemented Interfaces:
Broker, ElemenopeComponent, ElemenopeConnectionEntity, org.apache.xmlrpc.XmlRpcHandler

public class XmlRpcEnterpriseBroker
extends java.lang.Object
implements Broker, org.apache.xmlrpc.XmlRpcHandler

Enterprise XML-RPC implementation of the elemenope Broker interface.

This class provides XML-RPC service brokering functionality to elemenope with an embedded Jetty instance.

This Broker implementation must be configured with the following attributes:

class
Fully Qualified Class Name
e.g. com.createtank.elemenope.transports.XmlRpcEnterpriseBroker
operationGroup
name of configured operationGroup to which this Broker has access
required: YES
default: none
webServiceName
the name of the XML-RPC web service
required: no
default: serviceName (name of service as configured)
required: no
if this parameter is provided, the XML-RPC service will be available at the following URL:
http://hostname:port/serviceName/webServiceName.operationName

if this parameter is not provided, the XML-RPC service will be available at the following URL:
http://hostname:port/serviceName/serviceName.operationName

if one desires to place multiple XML-RPC web services (brokers) under a single context path (under a single Connector or listener), then one must define multiple Brokers, each with a different webServiceName configured.
That is, one may configure three webServices (Brokers) under a single URL/contextPath in the following manner:
 http://localhost:9000/externalInterface/serviceA.operationX
 http://localhost:9000/externalInterface/serviceB.operationY
 http://localhost:9000/externalInterface/serviceC.operationZ
 

For an example configuration, see the elemenope userguide

Author:
John Joseph Roets [joe@createtank.com]

Constructor Summary
XmlRpcEnterpriseBroker()
           
 
Method Summary
 void connect(Connector connector)
          Connects to the server and adds handler for both Jetty and XML-RPC.
 java.lang.Object execute(java.lang.String method, java.util.Vector params)
          Apache XML-RPC handler implementation.
 java.util.Map getConnectionAttributes()
          gets connectivity attributes
 java.lang.Object receive(OperationType object)
          Receives an Object into the elemenope framework.
 java.lang.Object receive(java.lang.String operationType, java.lang.Object object)
          Receives an Object into the elemenope framework.
 java.lang.Object receive(java.lang.String operationType, java.lang.Object object, java.util.Map atts)
          Receives an Object into the elemenope framework.
 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcEnterpriseBroker

public XmlRpcEnterpriseBroker()
Method Detail

receive

public java.lang.Object receive(java.lang.String operationType,
                                java.lang.Object object)
                         throws ElemenopeException
Description copied from interface: Broker
Receives an Object into the elemenope framework.

Must provide operation type explicitly.

Specified by:
receive in interface Broker
Parameters:
operationType - Configured name of operation type to call
object - Object to pass to Operation class
Returns:
Object returned by resultant called Operation class
Throws:
ElemenopeException

receive

public java.lang.Object receive(java.lang.String operationType,
                                java.lang.Object object,
                                java.util.Map atts)
                         throws ElemenopeException
Description copied from interface: Broker
Receives an Object into the elemenope framework.

Must provide operation type explicitly.

Specified by:
receive in interface Broker
Parameters:
operationType - Configured name of operation type to call
object - Object to pass to Operation class
atts - attributes for this message (used for asynch bpm attributes)
Returns:
Object returned by resultant called Operation class
Throws:
ElemenopeException

receive

public java.lang.Object receive(OperationType object)
                         throws ElemenopeException
Description copied from interface: Broker
Receives an Object into the elemenope framework. Allows an Object which implements OperationType interface.

Specified by:
receive in interface Broker
Returns:
Object returned by resultant called Operation class
Throws:
ElemenopeException

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

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

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

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

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

connect

public void connect(Connector connector)
             throws ElemenopeConnectionException
Connects to the server and adds handler for both Jetty and XML-RPC.

Parameters:
connector -
Throws:
ElemenopeConnectionException

execute

public java.lang.Object execute(java.lang.String method,
                                java.util.Vector params)
                         throws java.lang.Exception
Apache XML-RPC handler implementation. (non-Javadoc)

Specified by:
execute in interface org.apache.xmlrpc.XmlRpcHandler
Throws:
java.lang.Exception
See Also:
XmlRpcHandler.execute(java.lang.String, java.util.Vector)