Class AbstractAggregatingMessageGroupProcessor
java.lang.Object
org.springframework.integration.aggregator.AbstractAggregatingMessageGroupProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,MessageGroupProcessor
- Direct Known Subclasses:
DefaultAggregatingMessageGroupProcessor,ExpressionEvaluatingMessageGroupProcessor,MethodInvokingMessageGroupProcessor
public abstract class AbstractAggregatingMessageGroupProcessor
extends Object
implements MessageGroupProcessor, org.springframework.beans.factory.BeanFactoryAware
Base class for MessageGroupProcessor implementations that aggregate the group of Messages into a single Message.
- Since:
- 2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateHeaders(MessageGroup group) This default implementation simply returns all headers that have no conflicts among the group.protected abstract ObjectaggregatePayloads(MessageGroup group, Map<String, Object> defaultHeaders) protected Function<MessageGroup,Map<String, Object>> protected MessageBuilderFactoryfinal ObjectprocessMessageGroup(MessageGroup group) Process the given MessageGroup.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetHeadersFunction(Function<MessageGroup, Map<String, Object>> headersFunction) Specify aFunctionto mapMessageGroupinto composed headers for output message.
-
Field Details
-
logger
protected final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
AbstractAggregatingMessageGroupProcessor
public AbstractAggregatingMessageGroupProcessor()
-
-
Method Details
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
setHeadersFunction
Specify aFunctionto mapMessageGroupinto composed headers for output message.- Parameters:
headersFunction- theFunctionto use.- Since:
- 5.2
-
getHeadersFunction
-
getMessageBuilderFactory
-
processMessageGroup
Description copied from interface:MessageGroupProcessorProcess the given MessageGroup. Implementations are free to return as few or as many messages based on the invocation as needed. For example an aggregating processor will return only a single message representing the group, while a resequencing processor will return all messages whose preceding sequence has been satisfied.If a multiple messages are returned the return value must be a Collection<Message>.
- Specified by:
processMessageGroupin interfaceMessageGroupProcessor- Parameters:
group- The message group.- Returns:
- The result of processing the group.
-
aggregateHeaders
This default implementation simply returns all headers that have no conflicts among the group. An absent header on one or more Messages within the group is not considered a conflict. Subclasses may override this method with more advanced conflict-resolution strategies if necessary.- Parameters:
group- The message group.- Returns:
- The aggregated headers.
-
aggregatePayloads
-