public class ContentEnricher extends AbstractReplyProducingMessageHandler implements Lifecycle, IntegrationEvaluationContextAware
AbstractReplyProducingMessageHandler.RequestHandler
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ContentEnricher() |
Modifier and Type | Method and Description |
---|---|
protected void |
doInit()
Initializes the Content Enricher.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
boolean |
isRunning()
Lifecycle implementation.
|
void |
setHeaderExpressions(Map<String,HeaderValueMessageProcessor<?>> headerExpressions)
Provide the map of
HeaderValueMessageProcessor to evaluate when enriching
the target MessageHeaders. |
void |
setIntegrationEvaluationContext(EvaluationContext evaluationContext) |
void |
setPropertyExpressions(Map<String,Expression> propertyExpressions)
Provide the map of expressions to evaluate when enriching the target payload.
|
void |
setReplyChannel(MessageChannel replyChannel)
Sets the content enricher's reply channel.
|
void |
setReplyChannelName(String replyChannelName) |
void |
setReplyTimeout(Long replyTimeout)
Set the timeout value for receiving reply messages.
|
void |
setRequestChannel(MessageChannel requestChannel)
Sets the content enricher's request channel.
|
void |
setRequestChannelName(String requestChannelName) |
void |
setRequestPayloadExpression(Expression requestPayloadExpression)
By default the original message's payload will be used as the actual payload
that will be send to the request-channel.
|
void |
setRequestTimeout(Long requestTimeout)
Set the timeout value for sending request messages.
|
void |
setShouldClonePayload(boolean shouldClonePayload)
Specify whether to clone payload objects to create the target object.
|
void |
start()
Lifecycle implementation.
|
void |
stop()
Lifecycle implementation.
|
doInvokeAdvisedRequestHandler, getMessagingTemplate, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setChannelResolver, setOutputChannel, setOutputChannelName, setRequiresReply, setSendTimeout, shouldCopyRequestHeaders
getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public void setPropertyExpressions(Map<String,Expression> propertyExpressions)
propertyExpressions
- The property expressions.public void setHeaderExpressions(Map<String,HeaderValueMessageProcessor<?>> headerExpressions)
HeaderValueMessageProcessor
to evaluate when enriching
the target MessageHeaders.
The keys should simply be header names, and the values should be Expressions
that will evaluate against the reply Message as the root object.headerExpressions
- The header expressions.public void setRequestChannel(MessageChannel requestChannel)
requestChannel
- The request channel.public void setRequestChannelName(String requestChannelName)
public void setReplyChannel(MessageChannel replyChannel)
replyChannel
- The reply channel.public void setReplyChannelName(String replyChannelName)
public void setRequestTimeout(Long requestTimeout)
requestTimeout
- the timeout value in milliseconds. Must not be null.public void setReplyTimeout(Long replyTimeout)
replyTimeout
- the timeout value in milliseconds. Must not be null.public void setRequestPayloadExpression(Expression requestPayloadExpression)
requestPayloadExpression
- The request payload expression.public void setShouldClonePayload(boolean shouldClonePayload)
shouldClonePayload
- true if the payload should be cloned.public void setIntegrationEvaluationContext(EvaluationContext evaluationContext)
setIntegrationEvaluationContext
in interface IntegrationEvaluationContextAware
public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class AbstractMessageHandler
protected void doInit()
doInit
in class AbstractReplyProducingMessageHandler
protected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler
requestMessage
- The request message.null
.public void start()
public void stop()