public class OperationInvokingMessageHandler
extends org.springframework.integration.handler.AbstractReplyProducingMessageHandler
implements org.springframework.beans.factory.InitializingBean
MessageHandler implementation for invoking JMX operations based on
the Message sent to its AbstractMessageHandler.handleMessage(Message) method. Message headers
will be checked first when resolving the 'objectName' and 'operationName' to be
invoked on an MBean. These values would be supplied with the Message headers
defined as JmxHeaders.OBJECT_NAME and JmxHeaders.OPERATION_NAME,
respectively. In either case, if no header is present, the value resolution
will fallback to the defaults, if any have been configured on this instance via
setObjectName(String) and setOperationName(String),
respectively.
The operation parameter(s), if any, must be available within the payload of the Message being handled. If the target operation expects multiple parameters, they can be provided in either a List or Map typed payload.
messagingTemplateEXPRESSION_PARSER, logger| Constructor and Description |
|---|
OperationInvokingMessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit() |
java.lang.String |
getComponentType() |
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage) |
void |
setObjectName(java.lang.String objectName)
Specify a default ObjectName to use when no such header is
available on the Message being handled.
|
void |
setOperationName(java.lang.String operationName)
Specify an operation name to be invoked when no such
header is available on the Message being handled.
|
void |
setServer(javax.management.MBeanServerConnection server)
Provide a reference to the MBeanServer within which the MBean
target for operation invocation has been registered.
|
doInvokeAdvisedRequestHandler, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitafterPropertiesSetpublic void setServer(javax.management.MBeanServerConnection server)
server - The MBean server connection.public void setObjectName(java.lang.String objectName)
objectName - The object name.public void setOperationName(java.lang.String operationName)
operationName - The operation name.public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.handler.AbstractMessageHandlerprotected void doInit()
doInit in class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerprotected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
handleRequestMessage in class org.springframework.integration.handler.AbstractReplyProducingMessageHandler