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
Workflows link anAdaptrisMessageConsumer, aServceCollectionand anAdaptrisMessageProducer. They also provide error handling functionality.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPREVIOUS_GUID_KEYMetadata key for the unique ID of the message as it is being processed.static java.lang.StringWORKFLOW_ID_KEYMetadata 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 booleandisableMessageCount()Whether or not message-counts should be disabled on this workflow.voiddoProduce(AdaptrisMessage msg)Produce the message.AdaptrisMessageConsumergetConsumer()Returns thisWorkflow'sAdaptrisMessageConsumer.java.util.List<WorkflowInterceptor>getInterceptors()Return all the configured interceptors.ProcessingExceptionHandlergetMessageErrorHandler()Returns theProcessingExceptionHandlerto use.AdaptrisMessageProducergetProducer()Returns thisWorkflow'sAdaptrisMessageProducer.java.lang.StringgetUniqueId()Returns any configured unique-id.voidhandleBadMessage(AdaptrisMessage msg)Handle a 'bad' message.voidhandleProduceException()Handle anExceptionencountered producing a message.java.util.DatelastStartTime()Get the last time this workflow was startedjava.util.DatelastStopTime()Get the last time this workflow was stopped.ChannelobtainChannel()Returns a reference to thisWorkflow'sChannel.java.lang.StringobtainWorkflowId()Returns what the workflow considers to be it's unique ID of the workflow.voidregisterActiveMsgErrorHandler(ProcessingExceptionHandler meh)Sets theProcessingExceptionHandlerto use.voidregisterChannel(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- theAdaptrisMessageto 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
Exceptionin theServceCollectionorAdaptrisMessageProducer.- Parameters:
msg- the original version of the 'bad' message- Throws:
CoreException- wrapping any Exception that might occur
-
handleProduceException
void handleProduceException()
Handle an
Exceptionencountered 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:
getUniqueIdin interfaceAdaptrisComponent- Returns:
- the unique ID
-
getMessageErrorHandler
ProcessingExceptionHandler getMessageErrorHandler()
Returns the
ProcessingExceptionHandlerto use.- Returns:
- the ProcessingExceptionHandler to use
-
registerActiveMsgErrorHandler
void registerActiveMsgErrorHandler(ProcessingExceptionHandler meh)
Sets the
ProcessingExceptionHandlerto 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
-
-