Class DelegatingMessageGroupProcessor
java.lang.Object
org.springframework.integration.aggregator.DelegatingMessageGroupProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.Lifecycle,MessageGroupProcessor,ManageableLifecycle
public class DelegatingMessageGroupProcessor extends java.lang.Object implements MessageGroupProcessor, org.springframework.beans.factory.BeanFactoryAware, ManageableLifecycle
The
MessageGroupProcessor implementation with delegation to the provided delegate
and optional aggregation for headers.
Unlike AbstractAggregatingMessageGroupProcessor this processor checks a result
of the delegate call and aggregates headers into the output only
if the result is not a Message or AbstractIntegrationMessageBuilder.
This processor is used internally for wrapping provided non-standard MessageGroupProcessor
when a aggregate headers Function is provided.
For POJO method invoking or SpEL expression evaluation it is recommended to use an
AbstractAggregatingMessageGroupProcessor implementations.
- Since:
- 5.2
-
Constructor Summary
Constructors Constructor Description DelegatingMessageGroupProcessor(MessageGroupProcessor delegate, java.util.function.Function<MessageGroup,java.util.Map<java.lang.String,java.lang.Object>> headersFunction) -
Method Summary
Modifier and Type Method Description booleanisRunning()java.lang.ObjectprocessMessageGroup(MessageGroup group)Process the given MessageGroup.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidstart()voidstop()
-
Constructor Details
-
DelegatingMessageGroupProcessor
public DelegatingMessageGroupProcessor(MessageGroupProcessor delegate, java.util.function.Function<MessageGroup,java.util.Map<java.lang.String,java.lang.Object>> headersFunction)
-
-
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
-
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.
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceManageableLifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Specified by:
isRunningin interfaceManageableLifecycle
-