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 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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
cacheContains
(String msgId) getMode()
void
init()
Initialises the component.static boolean
removeEntry
(String msgId) void
Set the key for the cache.void
Set the mode.void
workflowEnd
(AdaptrisMessage inputMsg, AdaptrisMessage outputMsg) Mark the end of a workflow.void
workflowStart
(AdaptrisMessage inputMsg) Mark the start of a workflow.Methods inherited from class com.adaptris.core.http.jetty.JettyWorkflowInterceptorImpl
close, endWorkflow, messageComplete, start, stop
Methods inherited from class com.adaptris.core.interceptor.WorkflowInterceptorImpl
changeState, getUniqueId, parentChannel, parentWorkflow, prepare, registerParentChannel, registerParentWorkflow, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setUniqueId, wasSuccessful
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.WorkflowInterceptor
processingStart
-
Constructor Details
-
JettyAsyncWorkflowInterceptor
public JettyAsyncWorkflowInterceptor()
-
-
Method Details
-
init
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Overrides:
init
in classJettyWorkflowInterceptorImpl
- Throws:
CoreException
- wrapping any underlyingException
s
-
workflowStart
Description copied from interface:WorkflowInterceptor
Mark 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:WorkflowInterceptor
Mark 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
JettyMessageConsumer
which is not much.- Parameters:
s
- the cache key e.g. %message{JMSCorrelationID} when the mode isJettyAsyncWorkflowInterceptor.Mode.RESPONSE
;
-
withCacheKey
-