public class OperationInvokingMessageHandler extends AbstractReplyProducingMessageHandler implements 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.
AbstractReplyProducingMessageHandler.RequestHandlermessagingTemplateloggerHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
OperationInvokingMessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
void |
setObjectName(String objectName)
Specify a default ObjectName to use when no such header is
available on the Message being handled.
|
void |
setOperationName(String operationName)
Specify an operation name to be invoked when no such
header is available on the Message being handled.
|
void |
setServer(MBeanServerConnection server)
Provide a reference to the MBeanServer within which the MBean
target for operation invocation has been registered.
|
doInvokeAdvisedRequestHandler, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplygetOutputChannel, produceOutput, sendOutputs, setChannelResolver, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutputgetOrder, handleMessage, setOrder, setShouldTrackafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitafterPropertiesSetgetComponentNamepublic void setServer(MBeanServerConnection server)
server - The MBean server connection.public void setObjectName(String objectName)
objectName - The object name.public void setOperationName(String operationName)
operationName - The operation name.public String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void doInit()
doInit in class AbstractReplyProducingMessageHandlerprotected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandlerhandleRequestMessage in class AbstractReplyProducingMessageHandlerrequestMessage - The request message.null.