public class ExecutorChannel extends AbstractExecutorChannel
MessageChannel
that delegates to an instance of
UnicastingDispatcher
which in turn delegates all dispatching
invocations to an Executor
.
NOTE: unlike DirectChannel, the ExecutorChannel does not support a
shared transactional context between sender and handler, because the
Executor
typically does not block the sender's Thread since it
uses another Thread for the dispatch. (SyncTaskExecutor is an
exception but would provide no value for this channel. If synchronous
dispatching is required, a DirectChannel should be used instead).
AbstractExecutorChannel.MessageHandlingTask
AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
dispatcher, executor, executorInterceptorsSize, maxSubscribers
interceptors, meters
EXPRESSION_PARSER, logger
INDEFINITE_TIMEOUT
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
ExecutorChannel(Executor executor)
Create an ExecutorChannel that delegates to the provided
Executor when dispatching Messages. |
ExecutorChannel(Executor executor,
LoadBalancingStrategy loadBalancingStrategy)
Create an ExecutorChannel with a
LoadBalancingStrategy that
delegates to the provided Executor when dispatching Messages. |
Modifier and Type | Method and Description |
---|---|
protected UnicastingDispatcher |
getDispatcher() |
void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setFailover(boolean failover)
Specify whether the channel's dispatcher should have failover enabled.
|
addInterceptor, addInterceptor, getIntegrationPatternType, hasExecutorInterceptors, removeInterceptor, removeInterceptor, setInterceptors, setMaxSubscribers
doSend, getSubscriberCount, subscribe, unsubscribe
destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, registerMetricsCaptor, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setShouldTrack
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInterceptors
send, send
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
getBeanName, getComponentName
public ExecutorChannel(Executor executor)
Executor
when dispatching Messages.
The Executor must not be null.
executor
- The executor.public ExecutorChannel(Executor executor, LoadBalancingStrategy loadBalancingStrategy)
LoadBalancingStrategy
that
delegates to the provided Executor
when dispatching Messages.
The Executor must not be null.
executor
- The executor.loadBalancingStrategy
- The load balancing strategy implementation.public void setFailover(boolean failover)
failover
- The failover boolean.protected UnicastingDispatcher getDispatcher()
getDispatcher
in class AbstractSubscribableChannel
public final void onInit()
IntegrationObjectSupport
onInit
in class AbstractMessageChannel