Class OnOffMessageSource<T>

java.lang.Object
sk.antons.siutils.core.OnOffMessageSource<T>
All Implemented Interfaces:
org.springframework.integration.core.MessageSource<T>, org.springframework.integration.IntegrationPattern

public class OnOffMessageSource<T> extends Object implements org.springframework.integration.core.MessageSource<T>
Delegate MessageSource functionality to given messageSource only if given condition return true; (if there is no condition functionality is delegated always)
Author:
antons
  • Constructor Details

    • OnOffMessageSource

      public OnOffMessageSource(org.springframework.integration.core.MessageSource<T> delegate)
  • Method Details

    • condition

      public OnOffMessageSource condition(BooleanSupplier condition)
    • of

      public static <P> OnOffMessageSource<P> of(org.springframework.integration.core.MessageSource<P> delegate)
    • receive

      public org.springframework.messaging.Message<T> receive()
      Specified by:
      receive in interface org.springframework.integration.core.MessageSource<T>
    • getIntegrationPatternType

      public org.springframework.integration.IntegrationPatternType getIntegrationPatternType()
      Specified by:
      getIntegrationPatternType in interface org.springframework.integration.IntegrationPattern
      Specified by:
      getIntegrationPatternType in interface org.springframework.integration.core.MessageSource<T>