org.jboss.soa.esb.actions.routing
Class AbstractRouter

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractActionLifecycle
      extended by org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
          extended by org.jboss.soa.esb.actions.routing.AbstractRouter
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor
Direct Known Subclasses:
HttpRouter, JMSRouter

public abstract class AbstractRouter
extends AbstractActionPipelineProcessor

Abstract router.

Handles unwrapping of the message payload (if required) before routing. To turn on unwrapping, supply an "unwrap" property with a value of "true" (default "false").

Author:
tom.fennelly@jboss.com

Field Summary
protected  MessagePayloadProxy payloadProxy
           
 boolean unwrap
          Unwrap the message payload before routing.
 
Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
 
Constructor Summary
AbstractRouter(ConfigTree config)
          Public constructor.
 
Method Summary
 MessagePayloadProxy getPayloadProxy()
           
 Message process(Message message)
          Perform the action processing on the specified message.
abstract  void route(java.lang.Object object)
          Route the message or message payload.
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
processException, processSuccess
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
destroy, initialise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
destroy, initialise
 

Field Detail

unwrap

public boolean unwrap
Unwrap the message payload before routing.


payloadProxy

protected MessagePayloadProxy payloadProxy
Constructor Detail

AbstractRouter

public AbstractRouter(ConfigTree config)
               throws ConfigurationException
Public constructor.

Parameters:
config - Action config.
Throws:
ConfigurationException - Queue name not configured.
javax.jms.JMSException - Unable to configure JMS destination.
javax.naming.NamingException - Unable to configure JMS destination.
Method Detail

process

public Message process(Message message)
                throws ActionProcessingException
Description copied from interface: ActionPipelineProcessor
Perform the action processing on the specified message. This method is invoked for each message passing throught the pipeline.

Parameters:
message - The current message being processed.
Returns:
The message to be passed to the next stage of the pipeline.
Throws:
ActionProcessingException - for errors during processing.

getPayloadProxy

public MessagePayloadProxy getPayloadProxy()

route

public abstract void route(java.lang.Object object)
                    throws ActionProcessingException
Route the message or message payload.

If the message is to be unwrapped, it will have been unwrapped at this stage.

Parameters:
object - The object to route.
Throws:
ActionProcessingException - Exception during routing operation.