Class AbstractExecutorChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.channel.AbstractSubscribableChannel
org.springframework.integration.channel.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 ExecutorChannelInterceptor
s logic when the message handling
is handed to the Executor.execute(Runnable)
.
- Since:
- 4.2
- See Also:
ExecutorChannel
,PublishSubscribeChannel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractExecutorChannel.MessageHandlingTask
Nested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannel
AbstractMessageChannel.ChannelInterceptorList
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDispatcher
dispatcher
protected java.util.concurrent.Executor
executor
protected int
executorInterceptorsSize
protected java.lang.Integer
maxSubscribers
Fields inherited from class org.springframework.integration.channel.AbstractMessageChannel
interceptors, meters
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
-
Constructor Summary
Constructors Constructor Description AbstractExecutorChannel(java.util.concurrent.Executor executor)
-
Method Summary
Modifier and Type Method Description void
addInterceptor(int index, org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the specified index of the list.void
addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list.IntegrationPatternType
getIntegrationPatternType()
Return a pattern type this component implements.boolean
hasExecutorInterceptors()
org.springframework.messaging.support.ChannelInterceptor
removeInterceptor(int index)
boolean
removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
void
setInterceptors(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
Set the list of channel interceptors.void
setMaxSubscribers(int maxSubscribers)
Specify the maximum number of subscribers supported by the channel's dispatcher.Methods inherited from class org.springframework.integration.channel.AbstractSubscribableChannel
doSend, getDispatcher, getSubscriberCount, subscribe, unsubscribe
Methods inherited from class org.springframework.integration.channel.AbstractMessageChannel
destroy, getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isLoggingEnabled, onInit, registerMetricsCaptor, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setShouldTrack
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
Methods inherited from interface org.springframework.messaging.support.InterceptableChannel
getInterceptors
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Field Details
-
executor
protected java.util.concurrent.Executor executor -
dispatcher
-
maxSubscribers
protected java.lang.Integer maxSubscribers -
executorInterceptorsSize
protected int executorInterceptorsSize
-
-
Constructor Details
-
AbstractExecutorChannel
public AbstractExecutorChannel(@Nullable java.util.concurrent.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(java.util.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 interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
setInterceptors
in classAbstractMessageChannel
- 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 interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
addInterceptor
in classAbstractMessageChannel
- 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 interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
addInterceptor
in classAbstractMessageChannel
- Parameters:
index
- The index to add interceptor.interceptor
- The interceptor.
-
removeInterceptor
public boolean removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)- Specified by:
removeInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
removeInterceptor
in classAbstractMessageChannel
-
removeInterceptor
@Nullable public org.springframework.messaging.support.ChannelInterceptor removeInterceptor(int index)- Specified by:
removeInterceptor
in interfaceorg.springframework.messaging.support.InterceptableChannel
- Overrides:
removeInterceptor
in classAbstractMessageChannel
-
hasExecutorInterceptors
public boolean hasExecutorInterceptors()- Specified by:
hasExecutorInterceptors
in interfaceExecutorChannelInterceptorAware
-
getIntegrationPatternType
Description copied from interface:IntegrationPattern
Return a pattern type this component implements.- Specified by:
getIntegrationPatternType
in interfaceIntegrationPattern
- Overrides:
getIntegrationPatternType
in classAbstractMessageChannel
- Returns:
- the
IntegrationPatternType
this component implements.
-