public class OperationInvokingMessageHandler extends AbstractReplyProducingMessageHandler
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
IntegrationManagement.ManagementOverrides
messagingTemplate
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
OperationInvokingMessageHandler(MBeanServerConnection server)
Construct an instance based on the provided
MBeanServerConnection . |
Modifier and Type | Method and Description |
---|---|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
IntegrationPatternType |
getIntegrationPatternType()
Return a pattern type this component implements.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
void |
setExpectReply(boolean expectReply)
Specify whether a reply Message is expected.
|
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.
|
doInit, doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public OperationInvokingMessageHandler(MBeanServerConnection server)
MBeanServerConnection
.server
- the MBeanServerConnection
to use.public void setObjectName(String objectName)
objectName
- The object name.public void setOperationName(String operationName)
operationName
- The operation name.public void setExpectReply(boolean expectReply)
expectReply
- true if a reply is expected.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
public IntegrationPatternType getIntegrationPatternType()
IntegrationPattern
getIntegrationPatternType
in interface IntegrationPattern
getIntegrationPatternType
in class AbstractReplyProducingMessageHandler
IntegrationPatternType
this component implements.protected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler
requestMessage
- The request message.null
.