Class ExpressionCommandMessageProcessor
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.handler.AbstractMessageProcessor<Object>
org.springframework.integration.handler.ExpressionCommandMessageProcessor
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,MessageProcessor<Object>
,IntegrationPattern
public class ExpressionCommandMessageProcessor
extends AbstractMessageProcessor<Object>
implements IntegrationPattern
A MessageProcessor implementation that expects an Expression or expressionString
as the Message payload. When processing, it simply evaluates that expression.
- Since:
- 2.0
- Author:
- Dave Syer, Mark Fisher, Gary Russell, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger
-
Constructor Summary
ConstructorDescriptionExpressionCommandMessageProcessor
(MethodFilter methodFilter) ExpressionCommandMessageProcessor
(MethodFilter methodFilter, BeanFactory beanFactory) -
Method Summary
Modifier and TypeMethodDescriptionReturn a pattern type this component implements.processMessage
(Message<?> message) Evaluates the Message payload expression as a command.final void
setBeanFactory
(BeanFactory beanFactory) Specify a BeanFactory in order to enable resolution via@beanName
in the expression.Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setConversionService
-
Constructor Details
-
ExpressionCommandMessageProcessor
public ExpressionCommandMessageProcessor() -
ExpressionCommandMessageProcessor
-
ExpressionCommandMessageProcessor
public ExpressionCommandMessageProcessor(@Nullable MethodFilter methodFilter, @Nullable BeanFactory beanFactory)
-
-
Method Details
-
setBeanFactory
Description copied from class:AbstractExpressionEvaluator
Specify a BeanFactory in order to enable resolution via@beanName
in the expression.- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Overrides:
setBeanFactory
in classAbstractExpressionEvaluator
-
getIntegrationPatternType
Description copied from interface:IntegrationPattern
Return a pattern type this component implements.- Specified by:
getIntegrationPatternType
in interfaceIntegrationPattern
- Returns:
- the
IntegrationPatternType
this component implements.
-
processMessage
Evaluates the Message payload expression as a command.- Specified by:
processMessage
in interfaceMessageProcessor<Object>
- Specified by:
processMessage
in classAbstractMessageProcessor<Object>
- Parameters:
message
- The message to process.- Returns:
- The result.
- Throws:
IllegalArgumentException
- if the payload is not an Exception or String
-