public class ExecutorSubscribableChannel extends AbstractSubscribableChannel
SubscribableChannel
that sends messages to each of its subscribers.AbstractMessageChannel.ChannelInterceptorChain
logger
INDEFINITE_TIMEOUT
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
getSubscribers, hasSubscription, subscribe, unsubscribe
getBeanName, getInterceptors, getLogger, removeInterceptor, removeInterceptor, send, send, setBeanName, setLogger, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
send, send
public ExecutorSubscribableChannel()
ExecutorSubscribableChannel
instance
where messages will be sent in the callers thread.public ExecutorSubscribableChannel(@Nullable Executor executor)
ExecutorSubscribableChannel
instance
where messages will be sent via the specified executor.executor
- the executor used to send the message,
or null
to execute in the callers thread.public void setInterceptors(List<ChannelInterceptor> interceptors)
InterceptableChannel
setInterceptors
in interface InterceptableChannel
setInterceptors
in class AbstractMessageChannel
public void addInterceptor(ChannelInterceptor interceptor)
InterceptableChannel
addInterceptor
in interface InterceptableChannel
addInterceptor
in class AbstractMessageChannel
public void addInterceptor(int index, ChannelInterceptor interceptor)
InterceptableChannel
addInterceptor
in interface InterceptableChannel
addInterceptor
in class AbstractMessageChannel
public boolean sendInternal(Message<?> message, long timeout)
sendInternal
in class AbstractMessageChannel