Class CompoundTriggerAdvice

java.lang.Object
org.springframework.integration.aop.CompoundTriggerAdvice
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, MessageSourceMutator, ReceiveMessageAdvice

public class CompoundTriggerAdvice
extends java.lang.Object
implements MessageSourceMutator, ReceiveMessageAdvice
A MessageSourceMutator 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.

Since:
4.3
  • Constructor Summary

    Constructors 
    Constructor Description
    CompoundTriggerAdvice​(CompoundTrigger compoundTrigger, org.springframework.scheduling.Trigger overrideTrigger)  
  • Method Summary

    Modifier and Type Method Description
    org.springframework.messaging.Message<?> afterReceive​(org.springframework.messaging.Message<?> result, java.lang.Object source)
    Subclasses can take actions based on the result of the Joinpoint.proceed(); e.g.
    org.springframework.messaging.Message<?> afterReceive​(org.springframework.messaging.Message<?> result, MessageSource<?> source)
    Deprecated.
    since 5.3 in favor of afterReceive(Message, Object)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.aop.MessageSourceMutator

    beforeReceive, beforeReceive

    Methods inherited from interface org.springframework.integration.aop.ReceiveMessageAdvice

    invoke
  • Constructor Details

  • Method Details

    • afterReceive

      @Deprecated public org.springframework.messaging.Message<?> afterReceive​(org.springframework.messaging.Message<?> result, MessageSource<?> source)
      Deprecated.
      since 5.3 in favor of afterReceive(Message, Object)
      Description copied from interface: MessageSourceMutator
      Subclasses can take actions based on the result of the poll; e.g. adjust the trigger. The message can also be replaced with a new one.
      Specified by:
      afterReceive in interface MessageSourceMutator
      Parameters:
      result - the received message.
      source - the message source.
      Returns:
      the message or null
    • afterReceive

      @Nullable public org.springframework.messaging.Message<?> afterReceive​(@Nullable org.springframework.messaging.Message<?> result, java.lang.Object source)
      Description copied from interface: ReceiveMessageAdvice
      Subclasses can take actions based on the result of the Joinpoint.proceed(); e.g. adjust the trigger. The message can also be replaced with a new one.
      Specified by:
      afterReceive in interface MessageSourceMutator
      Specified by:
      afterReceive in interface ReceiveMessageAdvice
      Parameters:
      result - the received message.
      source - the source of the message to receive.
      Returns:
      a message to continue to process the result, null to discard whatever the Joinpoint.proceed() returned.