Class MethodInvokingMessageProcessor<T>
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.handler.AbstractMessageProcessor<T>
org.springframework.integration.handler.MethodInvokingMessageProcessor<T>
- Type Parameters:
- T- the expected payload type.
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- InitializingBean,- Lifecycle,- MessageProcessor<T>,- ManageableLifecycle
public class MethodInvokingMessageProcessor<T>
extends AbstractMessageProcessor<T>
implements ManageableLifecycle
A MessageProcessor implementation that invokes a method on a target Object.
 The Method instance or method name may be provided as a constructor argument.
 If a method name is provided, and more than one declared method has that name,
 the method-selection will be dynamic, based on the underlying SpEL method resolution.
 Alternatively, an annotation type may be provided so that the candidates for
 SpEL's method resolution are determined by the presence of that
 annotation rather than the method name.
- Since:
- 2.0
- Author:
- Dave Syer, Artem Bilan, Gary Russell
- 
Field SummaryFields inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorEXPRESSION_PARSER, logger
- 
Constructor SummaryConstructorsConstructorDescriptionMethodInvokingMessageProcessor(Object targetObject, Class<? extends Annotation> annotationType) MethodInvokingMessageProcessor(Object targetObject, Method method) MethodInvokingMessageProcessor(Object targetObject, String methodName) MethodInvokingMessageProcessor(Object targetObject, String methodName, boolean canProcessMessageList) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisAsync()booleanprocessMessage(Message<?> message) Process the Message and return a value (or null).voidsetBeanFactory(BeanFactory beanFactory) Specify a BeanFactory in order to enable resolution via@beanNamein the expression.voidsetConversionService(ConversionService conversionService) voidsetUseSpelInvoker(boolean useSpelInvoker) Abooleanflag to use SpEL Expression evaluation orInvocableHandlerMethodfor target method invocation.voidstart()voidstop()Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluatorafterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit
- 
Constructor Details- 
MethodInvokingMessageProcessor
- 
MethodInvokingMessageProcessor
- 
MethodInvokingMessageProcessor
- 
MethodInvokingMessageProcessorpublic MethodInvokingMessageProcessor(Object targetObject, Class<? extends Annotation> annotationType) 
 
- 
- 
Method Details- 
setConversionService- Overrides:
- setConversionServicein class- AbstractExpressionEvaluator
 
- 
setBeanFactoryDescription copied from class:AbstractExpressionEvaluatorSpecify a BeanFactory in order to enable resolution via@beanNamein the expression.- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Overrides:
- setBeanFactoryin class- AbstractExpressionEvaluator
 
- 
setUseSpelInvokerpublic void setUseSpelInvoker(boolean useSpelInvoker) Abooleanflag to use SpEL Expression evaluation orInvocableHandlerMethodfor target method invocation.- Parameters:
- useSpelInvoker- to use SpEL Expression evaluation or not.
- Since:
- 5.0
 
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
isAsyncpublic boolean isAsync()
- 
processMessageDescription copied from interface:MessageProcessorProcess the Message and return a value (or null).- Specified by:
- processMessagein interface- MessageProcessor<T>
- Specified by:
- processMessagein class- AbstractMessageProcessor<T>
- Parameters:
- message- The message to process.
- Returns:
- The result.
 
 
-