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

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
              extended by org.jboss.soa.esb.actions.routing.JMSRouter
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor

public class JMSRouter
extends AbstractRouter

JSM Routing Action Processor.

Sample Action Configuration:

 <action class="org.jboss.soa.esb.actions.routing.JMSRouter">
     jndiName="queue/A"
     message-prop->prop-name<=">prop-value<" >!-- (Optional)--< 
     unwrap="true/false" >!-- (Optional - default false)--<
 />
 
Note how properties to be set on the message are prefixed with "message-prop-".

To unwrap the message payload from the message before routing, set the "unwrap" property to "true". TODO: Add support for JMS Topic destinations.

Since:
Version 4.0
Author:
tom.fennelly@jboss.com

Field Summary
 
Fields inherited from class org.jboss.soa.esb.actions.routing.AbstractRouter
unwrap
 
Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
 
Constructor Summary
JMSRouter(ConfigTree propertiesTree)
          Public constructor.
JMSRouter(java.lang.String actionName, java.util.List<KeyValuePair> properties)
          Public constructor.
 
Method Summary
protected  void finalize()
           
 java.io.Serializable getErrorNotification(Message message)
           
 java.io.Serializable getOkNotification(Message message)
           
 void route(java.lang.Object message)
          Route the message or message payload.
 
Methods inherited from class org.jboss.soa.esb.actions.routing.AbstractRouter
process
 
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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.soa.esb.actions.ActionLifecycle
destroy, initialise
 

Constructor Detail

JMSRouter

public JMSRouter(ConfigTree propertiesTree)
          throws ConfigurationException,
                 javax.naming.NamingException,
                 javax.jms.JMSException
Public constructor.

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

JMSRouter

public JMSRouter(java.lang.String actionName,
                 java.util.List<KeyValuePair> properties)
          throws ConfigurationException
Public constructor.

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

route

public void route(java.lang.Object message)
           throws ActionProcessingException
Description copied from class: AbstractRouter
Route the message or message payload.

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

Specified by:
route in class AbstractRouter
Parameters:
message - The object to route.
Throws:
ActionProcessingException - Exception during routing operation.

getOkNotification

public java.io.Serializable getOkNotification(Message message)

getErrorNotification

public java.io.Serializable getErrorNotification(Message message)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable