Interface Workflow
-
- All Superinterfaces:
AdaptrisComponent
,AdaptrisMessageListener
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,EventHandlerAware
,StateManagedComponent
- All Known Implementing Classes:
JmsTransactedWorkflow
,LargeMessageWorkflow
,MultiProducerWorkflow
,PoolingWorkflow
,RequestReplyWorkflow
,StandardWorkflow
,StandardWorkflowImpl
,ThreadContextWorkflow
,WorkflowImp
,WorkflowWithObjectPool
public interface Workflow extends AdaptrisMessageListener, StateManagedComponent, EventHandlerAware, ComponentLifecycleExtension, ConfigComment
Workflow
s link anAdaptrisMessageConsumer
, aServceCollection
and anAdaptrisMessageProducer
. They also provide error handling functionality.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PREVIOUS_GUID_KEY
Metadata key for the unique ID of the message as it is being processed.static java.lang.String
WORKFLOW_ID_KEY
Metadata key used to store the ID of the workflow for processing bad messages.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
disableMessageCount()
Whether or not message-counts should be disabled on this workflow.void
doProduce(AdaptrisMessage msg)
Produce the message.AdaptrisMessageConsumer
getConsumer()
Returns thisWorkflow
'sAdaptrisMessageConsumer
.java.util.List<WorkflowInterceptor>
getInterceptors()
Return all the configured interceptors.ProcessingExceptionHandler
getMessageErrorHandler()
Returns theProcessingExceptionHandler
to use.AdaptrisMessageProducer
getProducer()
Returns thisWorkflow
'sAdaptrisMessageProducer
.java.lang.String
getUniqueId()
Returns any configured unique-id.void
handleBadMessage(AdaptrisMessage msg)
Handle a 'bad' message.void
handleProduceException()
Handle anException
encountered producing a message.java.util.Date
lastStartTime()
Get the last time this workflow was startedjava.util.Date
lastStopTime()
Get the last time this workflow was stopped.Channel
obtainChannel()
Returns a reference to thisWorkflow
'sChannel
.java.lang.String
obtainWorkflowId()
Returns what the workflow considers to be it's unique ID of the workflow.void
registerActiveMsgErrorHandler(ProcessingExceptionHandler meh)
Sets theProcessingExceptionHandler
to use.void
registerChannel(Channel ch)
Sets a reference to thisWorkflow
'sChannel
.-
Methods inherited from interface com.adaptris.core.AdaptrisMessageListener
friendlyName, onAdaptrisMessage, onAdaptrisMessage, onAdaptrisMessage
-
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init, start, stop
-
Methods inherited from interface com.adaptris.core.ComponentLifecycleExtension
prepare
-
Methods inherited from interface com.adaptris.core.ConfigComment
getComments, setComments
-
Methods inherited from interface com.adaptris.core.EventHandlerAware
registerEventHandler
-
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
-
-
-
Field Detail
-
WORKFLOW_ID_KEY
static final java.lang.String WORKFLOW_ID_KEY
Metadata key used to store the ID of the workflow for processing bad messages.
- See Also:
- Constant Field Values
-
PREVIOUS_GUID_KEY
static final java.lang.String PREVIOUS_GUID_KEY
Metadata key for the unique ID of the message as it is being processed. When it is retried it will have a new UUID, this metadata is used to link the two messages.
- See Also:
- Constant Field Values
-
-
Method Detail
-
doProduce
void doProduce(AdaptrisMessage msg) throws ServiceException, ProduceException
Produce the message.
- Parameters:
msg
- theAdaptrisMessage
to produce- Throws:
ProduceException
- if one is encountered producing either the request or the replyServiceException
- if one is encountered applying Services to a reply
-
handleBadMessage
void handleBadMessage(AdaptrisMessage msg) throws CoreException
Handle a 'bad' message. A bad message is one which has caused an
Exception
in theServceCollection
orAdaptrisMessageProducer
.- Parameters:
msg
- the original version of the 'bad' message- Throws:
CoreException
- wrapping any Exception that might occur
-
handleProduceException
void handleProduceException()
Handle an
Exception
encountered producing a message.
-
getConsumer
AdaptrisMessageConsumer getConsumer()
Returns this
Workflow
'sAdaptrisMessageConsumer
.- Returns:
- this
Workflow
'sAdaptrisMessageConsumer
-
getProducer
AdaptrisMessageProducer getProducer()
Returns this
Workflow
'sAdaptrisMessageProducer
.- Returns:
- this
Workflow
'sAdaptrisMessageProducer
-
obtainWorkflowId
java.lang.String obtainWorkflowId()
Returns what the workflow considers to be it's unique ID of the workflow.
This may differ from any 'unique-id' element that has been set.
- Returns:
- the unique ID
-
getUniqueId
java.lang.String getUniqueId()
Returns any configured unique-id.
- Specified by:
getUniqueId
in interfaceAdaptrisComponent
- Returns:
- the unique ID
-
getMessageErrorHandler
ProcessingExceptionHandler getMessageErrorHandler()
Returns the
ProcessingExceptionHandler
to use.- Returns:
- the ProcessingExceptionHandler to use
-
registerActiveMsgErrorHandler
void registerActiveMsgErrorHandler(ProcessingExceptionHandler meh)
Sets the
ProcessingExceptionHandler
to use.- Parameters:
meh
- the ProcessingExceptionHandler to use
-
obtainChannel
Channel obtainChannel()
Returns a reference to this
Workflow
'sChannel
.- Returns:
- a reference to this
Workflow
'sChannel
-
registerChannel
void registerChannel(Channel ch) throws CoreException
Sets a reference to this
Workflow
'sChannel
.- Parameters:
ch
- thisWorkflow
'sChannel
- Throws:
CoreException
-
lastStartTime
java.util.Date lastStartTime()
Get the last time this workflow was started- Returns:
- workflow start time
-
lastStopTime
java.util.Date lastStopTime()
Get the last time this workflow was stopped. This is set when the workflow is initialised so it may have been subsequently started.- Returns:
- channel stop time
-
getInterceptors
java.util.List<WorkflowInterceptor> getInterceptors()
Return all the configured interceptors.- Returns:
- all the configured interceptors.
-
disableMessageCount
boolean disableMessageCount()
Whether or not message-counts should be disabled on this workflow.- Since:
- 3.0.3
-
-