public class ExecutorSubscribableChannel extends AbstractSubscribableChannel
SubscribableChannel
that sends messages to each of its subscribers.Modifier and Type | Class and Description |
---|---|
private class |
ExecutorSubscribableChannel.ExecutorChannelInterceptorChain
Helps with the invocation of configured executor channel interceptors.
|
private static class |
ExecutorSubscribableChannel.SendTask
Helps with the invocation of the target MessageHandler and interceptors.
|
AbstractMessageChannel.ChannelInterceptorChain
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Executor |
executor |
private java.util.List<ExecutorChannelInterceptor> |
executorInterceptors |
logger
INDEFINITE_TIMEOUT
Constructor and Description |
---|
ExecutorSubscribableChannel()
Create a new
ExecutorSubscribableChannel instance where messages will be sent
in the callers thread. |
ExecutorSubscribableChannel(java.util.concurrent.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.
|
java.util.concurrent.Executor |
getExecutor() |
boolean |
sendInternal(Message<?> message,
long timeout) |
void |
setInterceptors(java.util.List<ChannelInterceptor> interceptors)
Set the list of channel interceptors.
|
getSubscribers, hasSubscription, subscribe, unsubscribe
getBeanName, getInterceptors, send, send, setBeanName, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
send, send
private final java.util.concurrent.Executor executor
private final java.util.List<ExecutorChannelInterceptor> executorInterceptors
public ExecutorSubscribableChannel()
ExecutorSubscribableChannel
instance where messages will be sent
in the callers thread.public ExecutorSubscribableChannel(java.util.concurrent.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 java.util.concurrent.Executor getExecutor()
public void setInterceptors(java.util.List<ChannelInterceptor> interceptors)
AbstractMessageChannel
setInterceptors
in class AbstractMessageChannel
public void addInterceptor(ChannelInterceptor interceptor)
AbstractMessageChannel
addInterceptor
in class AbstractMessageChannel
public boolean sendInternal(Message<?> message, long timeout)
sendInternal
in class AbstractMessageChannel