Class JmxSubmitMessageInterceptor
- java.lang.Object
-
- com.adaptris.core.runtime.JmxSubmitMessageInterceptor
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,WorkflowInterceptor
@ComponentProfile(summary="Interceptor for ensuring JMX submissions are handled correctly", tag="interceptor,jmx") public class JmxSubmitMessageInterceptor extends java.lang.Object implements WorkflowInterceptor
A
WorkflowInterceptor
that simply caches all messages that have completed running through the workflow.This implementation uses a
MessageCache
which is defaulted toLruBoundedMessageCache
.- Since:
- 3.0.4
In the adapter configuration file this class is aliased as jmx-submit-message-interceptor which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description JmxSubmitMessageInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.MessageCache
getMessageCache()
java.lang.String
getUniqueId()
Get the unique-id that is associated with this component.void
init()
Initialises the component.void
prepare()
Prepare for initialisation.void
registerParentChannel(Channel c)
Register the parent channel for this WorkflowInterceptor.void
registerParentWorkflow(Workflow w)
Register the parent workflow for this WorkflowInterceptor.void
setMessageCache(MessageCache messageCache)
void
setUniqueId(java.lang.String uniqueId)
void
start()
Starts the component.void
stop()
Stop the componentvoid
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adaptris.core.WorkflowInterceptor
processingStart
-
-
-
-
Method Detail
-
workflowStart
public void workflowStart(AdaptrisMessage inputMsg)
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.- Specified by:
workflowStart
in interfaceWorkflowInterceptor
- Parameters:
inputMsg
- the message that will be processed by this workflow.
-
workflowEnd
public void workflowEnd(AdaptrisMessage inputMsg, AdaptrisMessage outputMsg)
Description copied from interface:WorkflowInterceptor
Mark the end of a workflow.- Specified by:
workflowEnd
in interfaceWorkflowInterceptor
- 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:
CoreConstants.OBJ_METADATA_EXCEPTION
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- Specified by:
close
in interfaceComponentLifecycle
-
registerParentChannel
public void registerParentChannel(Channel c)
Description copied from interface:WorkflowInterceptor
Register the parent channel for this WorkflowInterceptor.- Specified by:
registerParentChannel
in interfaceWorkflowInterceptor
- Parameters:
c
- the channel
-
registerParentWorkflow
public void registerParentWorkflow(Workflow w)
Description copied from interface:WorkflowInterceptor
Register the parent workflow for this WorkflowInterceptor.- Specified by:
registerParentWorkflow
in interfaceWorkflowInterceptor
- Parameters:
w
- the workflow.
-
getUniqueId
public java.lang.String getUniqueId()
Description copied from interface:AdaptrisComponent
Get the unique-id that is associated with this component.- Specified by:
getUniqueId
in interfaceAdaptrisComponent
- Returns:
- the unique-id
-
setUniqueId
public void setUniqueId(java.lang.String uniqueId)
-
getMessageCache
public MessageCache getMessageCache()
-
setMessageCache
public void setMessageCache(MessageCache messageCache)
-
-