public class DelegatingMessageGroupProcessor extends Object implements MessageGroupProcessor, BeanFactoryAware, ManageableLifecycle
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.
Constructor and Description |
---|
DelegatingMessageGroupProcessor(MessageGroupProcessor delegate,
java.util.function.Function<MessageGroup,Map<String,Object>> headersFunction) |
Modifier and Type | Method and Description |
---|---|
boolean |
isRunning() |
Object |
processMessageGroup(MessageGroup group)
Process the given MessageGroup.
|
void |
setBeanFactory(BeanFactory beanFactory) |
void |
start() |
void |
stop() |
public DelegatingMessageGroupProcessor(MessageGroupProcessor delegate, java.util.function.Function<MessageGroup,Map<String,Object>> headersFunction)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public Object processMessageGroup(MessageGroup group)
MessageGroupProcessor
If a multiple messages are returned the return value must be a Collection<Message>.
processMessageGroup
in interface MessageGroupProcessor
group
- The message group.public void start()
start
in interface Lifecycle
start
in interface ManageableLifecycle
public void stop()
stop
in interface Lifecycle
stop
in interface ManageableLifecycle
public boolean isRunning()
isRunning
in interface Lifecycle
isRunning
in interface ManageableLifecycle