public class CompoundTriggerAdvice extends AbstractMessageSourceAdvice
AbstractMessageSourceAdvice
that uses a CompoundTrigger
to adjust
the poller - when a message is present, the compound trigger's primary trigger is
used to determine the next poll. When no message is present, the override trigger is
used.
The poller advised by this class must be configured to use the same
CompoundTrigger
instance and must not use a task executor.
Constructor and Description |
---|
CompoundTriggerAdvice(CompoundTrigger compoundTrigger,
Trigger overrideTrigger) |
Modifier and Type | Method and Description |
---|---|
Message<?> |
afterReceive(Message<?> result,
MessageSource<?> source)
Subclasses can take actions based on the result of the poll; e.g.
|
boolean |
beforeReceive(MessageSource<?> source)
Subclasses can decide whether to proceed with this poll.
|
invoke
public CompoundTriggerAdvice(CompoundTrigger compoundTrigger, Trigger overrideTrigger)
public boolean beforeReceive(MessageSource<?> source)
AbstractMessageSourceAdvice
beforeReceive
in class AbstractMessageSourceAdvice
source
- the message source.public Message<?> afterReceive(Message<?> result, MessageSource<?> source)
AbstractMessageSourceAdvice
trigger
. The message can also be replaced with a new one.afterReceive
in class AbstractMessageSourceAdvice
result
- the received message.source
- the message source.