Class AbstractFetchLimitingMessageSource<T>

java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.endpoint.AbstractMessageSource<T>
org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource<T>
Type Parameters:
T - the expected payload type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, MessageSource<T>, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, MessageSourceManagement

public abstract class AbstractFetchLimitingMessageSource<T>
extends AbstractMessageSource<T>
implements MessageSourceManagement
A message source that can limit the number of remote objects it fetches.
Since:
5.0
  • Constructor Details

  • Method Details

    • setMaxFetchSize

      public void setMaxFetchSize​(int maxFetchSize)
      Description copied from interface: MessageSourceManagement
      Set the maximum number of objects the source should fetch if it is necessary to fetch objects. Setting the maxFetchSize to 0 disables remote fetching, a negative value indicates no limit.
      Specified by:
      setMaxFetchSize in interface MessageSourceManagement
      Parameters:
      maxFetchSize - the max fetch size; a negative value means unlimited.
    • getMaxFetchSize

      public int getMaxFetchSize()
      Description copied from interface: MessageSourceManagement
      Return the max fetch size.
      Specified by:
      getMaxFetchSize in interface MessageSourceManagement
      Returns:
      the max fetch size.
      See Also:
      MessageSourceManagement.setMaxFetchSize(int)
    • doReceive

      protected java.lang.Object doReceive()
      Description copied from class: AbstractMessageSource
      Subclasses must implement this method. Typically the returned value will be the payload of type T, but the returned value may also be a Message instance whose payload is of type T; also can be AbstractIntegrationMessageBuilder which is used for additional headers population.
      Specified by:
      doReceive in class AbstractMessageSource<T>
      Returns:
      The value returned.
    • doReceive

      protected abstract java.lang.Object doReceive​(int maxFetchSizeToReceive)
      Subclasses must implement this method. Typically the returned value will be the payload of type T, but the returned value may also be a Message instance whose payload is of type T.
      Parameters:
      maxFetchSizeToReceive - the maximum number of messages to fetch if a fetch is necessary.
      Returns:
      The value returned.