org.jboss.soa.esb.actions
Class ContentBasedWiretap

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.ContentBasedWiretap
All Implemented Interfaces:
ActionLifecycle, ActionPipelineProcessor
Direct Known Subclasses:
ContentBasedRouter

public class ContentBasedWiretap
extends AbstractActionPipelineProcessor

ContentBasedWirtap implements the WireTap pattern. The WireTap is an Enterprise Integration Pattern (EIP) where a copy of the message is sent to a control channel.
The CBWT is identical in functionality to the ContentBasedRouter, however it does not terminate the pipeline which makes it suitable to be used as a WireTap.

Configuration Example:

<action class="org.jboss.soa.esb.actions.ContentBasedRouter" name="MyAction">
    <property name="ruleSet" value="OrderDiscountOnMultipleOrders.drl" />
    <property name="ruleReload" value="false" />
    <property name="ruleFireMethod" value="FIRE_ALL_RULES" />
    <property name="ruleAuditType" value="THREADED_FILE" />
    <property name="ruleAuditFile" value="/tmp/event" />
    <property name="ruleAuditInterval" value="1000" />
    <property name="ruleClockType" value="REALTIME" />
    <property name="ruleEventProcessingType" value="STREAM" />
    <property name="stateful" value="true" />
    <property name="object-paths">
        <object-path esb="body.TheOrderHeader" />
        <object-path esb="body.TheCustomer" />
        <object-path esb="body.TheOrderStatus" entry-point="OrderStatusEntry" />
        <object-path esb="body.TheOrderInfo" entry-point="OrderInfoEntry" />
    </property>
    <property name="channels">
        <!-- chan1 and chan2 are equivalent (but timeout only applies if async == false) -->
        <send-to channel-name="chan1" service-category="cat1" service-name="svc1" />
        <send-to channel-name="chan2" channel-class="org.jboss.soa.esb.services.rules.ServiceChannel" service-category="cat1" service-name="svc1" async="true" timeout="30000" set-payload-location="org.jboss.soa.esb.message.defaultEntry" />
        <!-- a custom channel -->
        <send-to channel-name="chan3" channel-class="com.example.MyChannel" />
    </property>
    <property name="destinations">
        <route-to destination-name="blue"  service-category="BlueTeam"  service-name="GoBlue" />
        <route-to destination-name="red"   service-category="RedTeam"   service-name="GoRed" />
        <route-to destination-name="green" service-category="GreenTeam" service-name="GoGreen" />
    </property>
</action>
Property description:

Author:
schifest@heuristica.com.ar, kstam@jboss.com, kevin.conner@jboss.com, Daniel Bevenius

Field Summary
protected  ContentBasedRouter _cbr
           
protected  java.lang.String _cbrClass
           
protected  ConfigTree _config
           
protected  java.util.Map<java.lang.String,Service> _destinations
           
protected static org.apache.log4j.Logger _logger
           
protected  ObjectMapper _mapper
           
protected  java.util.List<java.lang.String> _messagePathList
           
protected  Registry _registry
           
protected  java.lang.String _ruleLanguage
           
protected  boolean _ruleReload
           
protected  java.lang.String _ruleSet
           
static java.lang.String DEFAULT_CBR_CLASS
           
static java.lang.String ENTRY_POINT
           
protected  java.util.Map<java.lang.String,java.util.List<java.lang.String>> entryPointMap
           
protected  MessageMulticaster messageMulticaster
           
static java.lang.String OBJECT_PATH
           
static java.lang.String OBJECT_PATH_TAG
           
static java.lang.String ROUTE_TO_TAG
           
 
Fields inherited from interface org.jboss.soa.esb.actions.ActionPipelineProcessor
PROCESS_EXCEPTION_METHOD, PROCESS_METHOD, PROCESS_SUCCESS_METHOD
 
Constructor Summary
ContentBasedWiretap(ConfigTree config)
           
 
Method Summary
static java.lang.String buildDestinationKey(ConfigTree destinationConfig)
           
protected  void checkMyParms()
          Reading the piece of configTree specific to the CBR, and setting the configuration.
protected  java.util.List<Service> executeRules(Message message)
           
 void initialise()
          Initialise the action instance.
 Message process(Message message)
          Router the message to one or more destinations, using the ContentBasedRouter to figure out to which destinations it is going to be routed too.
protected  void routeMessage(Message message, java.util.List<Service> outgoingDestinations)
           
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionPipelineProcessor
processException, processSuccess
 
Methods inherited from class org.jboss.soa.esb.actions.AbstractActionLifecycle
destroy
 
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
 

Field Detail

ROUTE_TO_TAG

public static final java.lang.String ROUTE_TO_TAG
See Also:
Constant Field Values

OBJECT_PATH_TAG

public static final java.lang.String OBJECT_PATH_TAG
See Also:
Constant Field Values

OBJECT_PATH

public static final java.lang.String OBJECT_PATH
See Also:
Constant Field Values

ENTRY_POINT

public static final java.lang.String ENTRY_POINT
See Also:
Constant Field Values

DEFAULT_CBR_CLASS

public static final java.lang.String DEFAULT_CBR_CLASS
See Also:
Constant Field Values

_config

protected ConfigTree _config

_destinations

protected java.util.Map<java.lang.String,Service> _destinations

messageMulticaster

protected MessageMulticaster messageMulticaster

_cbrClass

protected java.lang.String _cbrClass

_ruleSet

protected java.lang.String _ruleSet

_ruleLanguage

protected java.lang.String _ruleLanguage

_ruleReload

protected boolean _ruleReload

_messagePathList

protected java.util.List<java.lang.String> _messagePathList

entryPointMap

protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> entryPointMap

_mapper

protected ObjectMapper _mapper

_registry

protected Registry _registry

_cbr

protected ContentBasedRouter _cbr

_logger

protected static final org.apache.log4j.Logger _logger
Constructor Detail

ContentBasedWiretap

public ContentBasedWiretap(ConfigTree config)
                    throws ConfigurationException,
                           RegistryException,
                           MessageRouterException
Throws:
ConfigurationException
RegistryException
MessageRouterException
Method Detail

initialise

public void initialise()
Description copied from class: AbstractActionLifecycle
Initialise the action instance.

This method is called after the action instance has been instantiated so that configuration options can be validated.

Specified by:
initialise in interface ActionLifecycle
Overrides:
initialise in class AbstractActionLifecycle

process

public Message process(Message message)
                throws ActionProcessingException
Router the message to one or more destinations, using the ContentBasedRouter to figure out to which destinations it is going to be routed too.

Parameters:
message -
Returns:
Message
Throws:
ActionProcessingException

executeRules

protected java.util.List<Service> executeRules(Message message)
                                        throws MessageRouterException
Throws:
MessageRouterException

routeMessage

protected final void routeMessage(Message message,
                                  java.util.List<Service> outgoingDestinations)
                           throws MessageRouterException
Throws:
MessageRouterException

checkMyParms

protected void checkMyParms()
                     throws ConfigurationException
Reading the piece of configTree specific to the CBR, and setting the configuration.

Throws:
ConfigurationException

buildDestinationKey

public static java.lang.String buildDestinationKey(ConfigTree destinationConfig)
                                            throws ConfigurationException
Throws:
ConfigurationException