@ComponentProfile(summary="Workflow that has multiple additional producers in addition to the normal producer", tag="workflow,base") public class MultiProducerWorkflow extends StandardWorkflow
Workflow
that contains multiple producers.
Implementation of Workflow
that over-rides sendProcessedMessage
to use a List
of
StandaloneProducer
s. NB the main 'produce', from which the success or failure of the workflow is determined, is
still configured in Workflow
itself, and any failures producing below are only logged.
In the adapter configuration file this class is aliased as multi-producer-workflow. which is the preferred alternative to the fully qualified classname when building your configuration.
eventHandler, log, startTime, stopTime
PREVIOUS_GUID_KEY, WORKFLOW_ID_KEY
Constructor and Description |
---|
MultiProducerWorkflow()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addStandaloneProducer(StandaloneProducer producer)
Adds a
StandaloneProducer to the List of
producers which will be used to send the processed message. |
protected void |
closeWorkflow()
Close the workflow.
|
java.util.List<StandaloneProducer> |
getStandaloneProducers()
Returns the
List of underlying StandaloneProducer
s used to send processed messages. |
java.lang.Boolean |
getUseProcessedMessage()
Returns whether the processed message should be used by the processed
message producer.
|
protected void |
initialiseWorkflow()
Initialise the workflow.
|
void |
onAdaptrisMessage(AdaptrisMessage msg)
This method is
synchronized in case client code is
multi-threaded. |
protected void |
prepareWorkflow() |
protected void |
resubmitMessage(AdaptrisMessage msg)
Resubmit a message upon the channel becoming available again.
|
void |
setStandaloneProducers(java.util.List<StandaloneProducer> l)
Set the
List of underlying StandaloneProducer s
used to send processed messages. |
void |
setUseProcessedMessage(java.lang.Boolean useProc)
Sets whether the processed message should be used by the processed message
producer (as opposed to the original incoming message).
|
protected void |
startWorkflow()
Start the workflow.
|
protected void |
stopWorkflow()
Stop the workflow.
|
handleMessage
addConsumeLocation, addInterceptor, changeState, channelUnavailableWait, close, copyExceptionHeaders, disableMessageCount, doProduce, friendlyName, getChannelUnavailableWaitInterval, getComments, getConsumer, getDisableDefaultMessageCount, getInterceptors, getLogPayload, getMessageErrorHandler, getMessageLogger, getProduceExceptionHandler, getProducer, getSendEvents, getServiceCollection, getUniqueId, handleBadMessage, handleBadMessage, handleChannelUnavailable, handleProduceException, init, lastStartTime, lastStopTime, logSuccess, messageLogger, obtainChannel, obtainWorkflowId, prepare, processingStart, registerActiveMsgErrorHandler, registerChannel, registerEventHandler, requestClose, requestInit, requestStart, requestStop, retrieveActiveMsgErrorHandler, retrieveComponentState, sendMessageLifecycleEvent, setChannelUnavailableWaitInterval, setComments, setConsumer, setDisableDefaultMessageCount, setInterceptors, setLogPayload, setMessageErrorHandler, setMessageLogger, setProduceExceptionHandler, setProducer, setSendEvents, setServiceCollection, setUniqueId, start, stop, workflowEnd, workflowStart
public void onAdaptrisMessage(AdaptrisMessage msg)
This method is synchronized
in case client code is
multi-threaded.
onAdaptrisMessage
in interface AdaptrisMessageListener
onAdaptrisMessage
in class StandardWorkflow
msg
- the AdaptrisMessage
to processAdaptrisMessageListener.onAdaptrisMessage(AdaptrisMessage)
protected void resubmitMessage(AdaptrisMessage msg)
WorkflowImp
resubmitMessage
in class StandardWorkflow
msg
- the AdaptrisMessage.WorkflowImp.resubmitMessage(com.adaptris.core.AdaptrisMessage)
protected void initialiseWorkflow() throws CoreException
WorkflowImp
initialiseWorkflow
in class StandardWorkflowImpl
CoreException
- encapsulating any underlying ExceptionWorkflowImp.initialiseWorkflow()
protected void startWorkflow() throws CoreException
WorkflowImp
startWorkflow
in class StandardWorkflowImpl
CoreException
- encapsulating any underlying ExceptionWorkflowImp.startWorkflow()
protected void stopWorkflow()
WorkflowImp
stopWorkflow
in class StandardWorkflowImpl
WorkflowImp.stopWorkflow()
protected void closeWorkflow()
WorkflowImp
closeWorkflow
in class StandardWorkflowImpl
WorkflowImp.closeWorkflow()
public void addStandaloneProducer(StandaloneProducer producer)
Adds a StandaloneProducer
to the List
of
producers which will be used to send the processed message.
producer
- the StandaloneProducer
to add.public java.util.List<StandaloneProducer> getStandaloneProducers()
Returns the List
of underlying StandaloneProducer
s used to send processed messages.
List
of underlying StandaloneProducer
s used to send processed messagespublic void setStandaloneProducers(java.util.List<StandaloneProducer> l)
Set the List
of underlying StandaloneProducer
s
used to send processed messages.
l
- the List
of underlying
StandaloneProducer
s used to send processed messagespublic void setUseProcessedMessage(java.lang.Boolean useProc)
Sets whether the processed message should be used by the processed message producer (as opposed to the original incoming message).
useProc
- whether the processed message should be used by the
processed message producerpublic java.lang.Boolean getUseProcessedMessage()
Returns whether the processed message should be used by the processed message producer.
protected void prepareWorkflow() throws CoreException
prepareWorkflow
in class StandardWorkflowImpl
CoreException