Class ExpressionCommandMessageProcessor
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.handler.AbstractMessageProcessor<java.lang.Object>
org.springframework.integration.handler.ExpressionCommandMessageProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.InitializingBean,MessageProcessor<java.lang.Object>,IntegrationPattern
public class ExpressionCommandMessageProcessor extends AbstractMessageProcessor<java.lang.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
-
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors Constructor Description ExpressionCommandMessageProcessor()ExpressionCommandMessageProcessor(org.springframework.expression.MethodFilter methodFilter)ExpressionCommandMessageProcessor(org.springframework.expression.MethodFilter methodFilter, org.springframework.beans.factory.BeanFactory beanFactory) -
Method Summary
Modifier and Type Method Description IntegrationPatternTypegetIntegrationPatternType()Return a pattern type this component implements.java.lang.ObjectprocessMessage(org.springframework.messaging.Message<?> message)Evaluates the Message payload expression as a command.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)Specify a BeanFactory in order to enable resolution via@beanNamein 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
public ExpressionCommandMessageProcessor(@Nullable org.springframework.expression.MethodFilter methodFilter) -
ExpressionCommandMessageProcessor
public ExpressionCommandMessageProcessor(@Nullable org.springframework.expression.MethodFilter methodFilter, @Nullable org.springframework.beans.factory.BeanFactory beanFactory)
-
-
Method Details
-
setBeanFactory
public final void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)Description copied from class:AbstractExpressionEvaluatorSpecify a BeanFactory in order to enable resolution via@beanNamein the expression.- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Overrides:
setBeanFactoryin classAbstractExpressionEvaluator
-
getIntegrationPatternType
Description copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
getIntegrationPatternTypein interfaceIntegrationPattern- Returns:
- the
IntegrationPatternTypethis component implements.
-
processMessage
@Nullable public java.lang.Object processMessage(org.springframework.messaging.Message<?> message)Evaluates the Message payload expression as a command.- Specified by:
processMessagein interfaceMessageProcessor<java.lang.Object>- Specified by:
processMessagein classAbstractMessageProcessor<java.lang.Object>- Parameters:
message- The message to process.- Returns:
- The result.
- Throws:
java.lang.IllegalArgumentException- if the payload is not an Exception or String
-