Class DelegatingMessageGroupProcessor
java.lang.Object
org.springframework.integration.aggregator.DelegatingMessageGroupProcessor
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,Lifecycle
,MessageGroupProcessor
,ManageableLifecycle
public class DelegatingMessageGroupProcessor
extends Object
implements MessageGroupProcessor, 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
- Author:
- Artem Bilan
-
Constructor Summary
ConstructorDescriptionDelegatingMessageGroupProcessor
(MessageGroupProcessor delegate, Function<MessageGroup, Map<String, Object>> headersFunction) -
Method Summary
Modifier and TypeMethodDescriptionboolean
processMessageGroup
(MessageGroup group) Process the given MessageGroup.void
setBeanFactory
(BeanFactory beanFactory) void
start()
void
stop()
-
Constructor Details
-
DelegatingMessageGroupProcessor
public DelegatingMessageGroupProcessor(MessageGroupProcessor delegate, Function<MessageGroup, Map<String, Object>> headersFunction)
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
processMessageGroup
Description copied from interface:MessageGroupProcessor
Process 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:
processMessageGroup
in interfaceMessageGroupProcessor
- Parameters:
group
- The message group.- Returns:
- The result of processing the group.
-
start
public void start()- Specified by:
start
in interfaceLifecycle
- Specified by:
start
in interfaceManageableLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceLifecycle
- Specified by:
stop
in interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceLifecycle
- Specified by:
isRunning
in interfaceManageableLifecycle
-