org.springframework.messaging.support

## Class ExecutorSubscribableChannel

- java.lang.Object
- - org.springframework.messaging.support.AbstractMessageChannel
  - - org.springframework.messaging.support.AbstractSubscribableChannel
    - - org.springframework.messaging.support.ExecutorSubscribableChannel

All Implemented Interfaces:
  org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, MessageChannel, SubscribableChannel, InterceptableChannel

    public class ExecutorSubscribableChannel
    extends AbstractSubscribableChannel

A `SubscribableChannel` that sends messages to each of its subscribers.

Since:
  4.0
Author:
  Phillip Webb, Rossen Stoyanchev

### Nested Class Summary

### Nested classes/interfaces inherited from class org.springframework.messaging.support.AbstractMessageChannel

`AbstractMessageChannel.ChannelInterceptorChain`

### Field Summary

### Fields inherited from class org.springframework.messaging.support.AbstractMessageChannel

`logger`

### Fields inherited from interface org.springframework.messaging.MessageChannel

`INDEFINITE_TIMEOUT`

### Constructor Summary

Constructors
Constructor and Description
`ExecutorSubscribableChannel()` Create a new `ExecutorSubscribableChannel` instance where messages will be sent in the callers thread.
`ExecutorSubscribableChannel(Executor executor)` Create a new `ExecutorSubscribableChannel` instance where messages will be sent via the specified executor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addInterceptor(ChannelInterceptor interceptor)` Add a channel interceptor to the end of the list.
`void` `addInterceptor(int index, ChannelInterceptor interceptor)` Add a channel interceptor at the specified index.
`Executor` `getExecutor()`
`boolean` `sendInternal(Message<?> message, long timeout)`
`void` `setInterceptors(List<ChannelInterceptor> interceptors)` Set the list of channel interceptors clearing any existing interceptors.

### Methods inherited from class org.springframework.messaging.support.AbstractSubscribableChannel

`getSubscribers, hasSubscription, subscribe, unsubscribe`

### Methods inherited from class org.springframework.messaging.support.AbstractMessageChannel

`getBeanName, getInterceptors, getLogger, removeInterceptor, removeInterceptor, send, send, setBeanName, setLogger, toString`

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface org.springframework.messaging.MessageChannel

`send, send`

### Constructor Detail

#### ExecutorSubscribableChannel

    public ExecutorSubscribableChannel()

Create a new `ExecutorSubscribableChannel` instance where messages will be sent in the callers thread.

#### ExecutorSubscribableChannel

    public ExecutorSubscribableChannel(@Nullable
                                       Executor executor)

Create a new `ExecutorSubscribableChannel` instance where messages will be sent via the specified executor.

Parameters:
  `executor` - the executor used to send the message, or `null` to execute in the callers thread.

### Method Detail

#### getExecutor

    @Nullable
    public Executor getExecutor()

#### setInterceptors

    public void setInterceptors(List<ChannelInterceptor> interceptors)

Description copied from interface: `InterceptableChannel`
Set the list of channel interceptors clearing any existing interceptors.

Specified by:
  `setInterceptors` in interface `InterceptableChannel`
Overrides:
  `setInterceptors` in class `AbstractMessageChannel`

#### addInterceptor

    public void addInterceptor(ChannelInterceptor interceptor)

Description copied from interface: `InterceptableChannel`
Add a channel interceptor to the end of the list.

Specified by:
  `addInterceptor` in interface `InterceptableChannel`
Overrides:
  `addInterceptor` in class `AbstractMessageChannel`

#### addInterceptor

    public void addInterceptor(int index,
                               ChannelInterceptor interceptor)

Description copied from interface: `InterceptableChannel`
Add a channel interceptor at the specified index.

Specified by:
  `addInterceptor` in interface `InterceptableChannel`
Overrides:
  `addInterceptor` in class `AbstractMessageChannel`

#### sendInternal

    public boolean sendInternal(Message<?> message,
                                long timeout)

Specified by:
  `sendInternal` in class `AbstractMessageChannel`