Class JettyAsyncWorkflowInterceptor
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,StateManagedComponent,WorkflowInterceptor
Configure one of these with mode=REQUEST in the workflow with the JettyMessageConsumer; and then in your reply
workflow, configure one of these with mode=RESPONSE. When the reply workflow is finished; then the jetty response will be
committed back to the caller.
- Since:
- 3.7.3
In the adapter configuration file this class is aliased as jetty-async-workflow-interceptor which is the preferred alternative to the fully qualified classname when building your configuration.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
WorkflowInterceptorImpl.WorkflowInterceptorException -
Field Summary
Fields inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancacheContains(String msgId) getMode()voidinit()Initialises the component.static booleanremoveEntry(String msgId) voidSet the key for the cache.voidSet the mode.voidworkflowEnd(AdaptrisMessage inputMsg, AdaptrisMessage outputMsg) Mark the end of a workflow.voidworkflowStart(AdaptrisMessage inputMsg) Mark the start of a workflow.Methods inherited from class com.adaptris.core.http.jetty.JettyWorkflowInterceptorImpl
close, endWorkflow, messageComplete, start, stopMethods inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
changeState, getUniqueId, parentChannel, parentWorkflow, prepare, registerParentChannel, registerParentWorkflow, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setUniqueId, wasSuccessfulMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.adaptris.core.WorkflowInterceptor
processingStart
-
Constructor Details
-
JettyAsyncWorkflowInterceptor
public JettyAsyncWorkflowInterceptor()
-
-
Method Details
-
init
Description copied from interface:ComponentLifecycleInitialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
initin interfaceComponentLifecycle- Overrides:
initin classJettyWorkflowInterceptorImpl- Throws:
CoreException- wrapping any underlyingExceptions
-
workflowStart
Description copied from interface:WorkflowInterceptorMark the start of a workflow. This doesn't mean the message has started processing but only that the message will - at some point - be processed by the workflow.- Parameters:
inputMsg- the message that will be processed by this workflow.
-
workflowEnd
Description copied from interface:WorkflowInterceptorMark the end of a workflow.- Parameters:
inputMsg- the original message that was originally submitted to the workflow; in the event of an exception during processing, the exception will be stored in object metadata in the inputMsgoutputMsg- the message contaning any changes that may have been applied by the services within the workflow.- See Also:
-
getMode
-
setMode
Set the mode.- Parameters:
m-
-
withMode
-
cacheContains
-
removeEntry
-
getCacheKey
-
setCacheKey
Set the key for the cache.Set the key in the cache that will be used to track the underlying response. If left blank, then it will use
InterlokMessage.getUniqueId()as the key. If specified, then that key (after metadata solution viaInterlokMessage.resolve(String)) will be used.Generally speaking JMS providers will assign a message-id for you when you create a
javax.jms.Message; this becomes theInterlokMessage.getUniqueId()in most cases. If Interlok is in use at all stages, then this can be left blank, as we will try as much to preserve our message unique-id across JMS providers; if there is an external application integrated with JMS, then you might need to specify a value here so that theJMSCorrelationID(viaMetadataCorrelationIdSource) is used to key the cache when responding back to the HTTP client.Note that because this is an interceptor; the only metadata you have is that which is present upon entry into the workflow (i.e. that set by the consumer); in REQUEST mode, you only get the metadata that is set by
JettyMessageConsumerwhich is not much.- Parameters:
s- the cache key e.g. %message{JMSCorrelationID} when the mode isJettyAsyncWorkflowInterceptor.Mode.RESPONSE;
-
withCacheKey
-