public class OperationInvokingMessageHandler extends 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.
AbstractReplyProducingMessageHandler.RequestHandler
logger
Constructor and Description |
---|
OperationInvokingMessageHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
doInit() |
protected java.lang.Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
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, getMessagingTemplate, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setChannelResolver, setOutputChannel, setRequiresReply, setSendTimeout, shouldCopyRequestHeaders
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
afterPropertiesSet
getComponentName
public void setServer(javax.management.MBeanServerConnection server)
public void setObjectName(java.lang.String objectName)
public void setOperationName(java.lang.String operationName)
protected void doInit()
doInit
in class AbstractReplyProducingMessageHandler
protected java.lang.Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler