Class AbstractExecutorChannel

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, org.springframework.context.ApplicationContextAware, ExecutorChannelInterceptorAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationManagement, SubscribableChannelManagement, TrackableComponent, org.springframework.messaging.MessageChannel, org.springframework.messaging.SubscribableChannel, org.springframework.messaging.support.InterceptableChannel
Direct Known Subclasses:
ExecutorChannel, PublishSubscribeChannel

public abstract class AbstractExecutorChannel extends AbstractSubscribableChannel implements ExecutorChannelInterceptorAware
The AbstractSubscribableChannel base implementation for those inheritors which logic may be based on the Executor.

Utilizes common operations for the AbstractDispatcher.

Implements the ExecutorChannelInterceptors logic when the message handling is handed to the Executor.execute(Runnable).

Since:
4.2
See Also:
  • Field Details

    • executor

      protected Executor executor
    • dispatcher

      protected AbstractDispatcher dispatcher
    • maxSubscribers

      protected Integer maxSubscribers
    • executorInterceptorsSize

      protected int executorInterceptorsSize
  • Constructor Details

    • AbstractExecutorChannel

      public AbstractExecutorChannel(@Nullable Executor executor)
  • Method Details

    • setMaxSubscribers

      public void setMaxSubscribers(int maxSubscribers)
      Specify the maximum number of subscribers supported by the channel's dispatcher.
      Parameters:
      maxSubscribers - The maximum number of subscribers allowed.
    • setInterceptors

      public void setInterceptors(List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
      Description copied from class: AbstractMessageChannel
      Set the list of channel interceptors. This will clear any existing interceptors.
      Specified by:
      setInterceptors in interface org.springframework.messaging.support.InterceptableChannel
      Overrides:
      setInterceptors in class AbstractMessageChannel
      Parameters:
      interceptors - The list of interceptors.
    • addInterceptor

      public void addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
      Description copied from class: AbstractMessageChannel
      Add a channel interceptor to the end of the list.
      Specified by:
      addInterceptor in interface org.springframework.messaging.support.InterceptableChannel
      Overrides:
      addInterceptor in class AbstractMessageChannel
      Parameters:
      interceptor - The interceptor.
    • addInterceptor

      public void addInterceptor(int index, org.springframework.messaging.support.ChannelInterceptor interceptor)
      Description copied from class: AbstractMessageChannel
      Add a channel interceptor to the specified index of the list.
      Specified by:
      addInterceptor in interface org.springframework.messaging.support.InterceptableChannel
      Overrides:
      addInterceptor in class AbstractMessageChannel
      Parameters:
      index - The index to add interceptor.
      interceptor - The interceptor.
    • removeInterceptor

      public boolean removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
      Specified by:
      removeInterceptor in interface org.springframework.messaging.support.InterceptableChannel
      Overrides:
      removeInterceptor in class AbstractMessageChannel
    • removeInterceptor

      @Nullable public org.springframework.messaging.support.ChannelInterceptor removeInterceptor(int index)
      Specified by:
      removeInterceptor in interface org.springframework.messaging.support.InterceptableChannel
      Overrides:
      removeInterceptor in class AbstractMessageChannel
    • hasExecutorInterceptors

      public boolean hasExecutorInterceptors()
      Specified by:
      hasExecutorInterceptors in interface ExecutorChannelInterceptorAware
    • getIntegrationPatternType

      public IntegrationPatternType getIntegrationPatternType()
      Description copied from interface: IntegrationPattern
      Return a pattern type this component implements.
      Specified by:
      getIntegrationPatternType in interface IntegrationPattern
      Overrides:
      getIntegrationPatternType in class AbstractMessageChannel
      Returns:
      the IntegrationPatternType this component implements.