Class AbstractPollableChannel
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
org.springframework.integration.channel.AbstractPollableChannel
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- ExecutorChannelInterceptorAware,- ComponentSourceAware,- ExpressionCapable,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- TrackableComponent,- MessageChannel,- PollableChannel,- InterceptableChannel
- Direct Known Subclasses:
- QueueChannel
public abstract class AbstractPollableChannel
extends AbstractMessageChannel
implements PollableChannel, ExecutorChannelInterceptorAware
Base class for all pollable channels.
- Author:
- Mark Fisher, Artem Bilan, Gary Russell, Artem Bilan, Trung Pham
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.channel.AbstractMessageChannelAbstractMessageChannel.ChannelInterceptorListNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.channel.AbstractMessageChannelinterceptors, metersFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.messaging.MessageChannelINDEFINITE_TIMEOUT
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInterceptor(int index, ChannelInterceptor interceptor) Add a channel interceptor to the specified index of the list.voidaddInterceptor(ChannelInterceptor interceptor) Add a channel interceptor to the end of the list.protected abstract Message<?> doReceive(long timeout) Subclasses must implement this method.Return a pattern type this component implements.booleanMessage<?> receive()Receive the first available message from this channel.Message<?> receive(long timeout) Receive the first available message from this channel.removeInterceptor(int index) booleanremoveInterceptor(ChannelInterceptor interceptor) voidsetInterceptors(List<ChannelInterceptor> interceptors) Set the list of channel interceptors.Methods inherited from class org.springframework.integration.channel.AbstractMessageChanneldestroy, doSend, getComponentType, getFullChannelName, getIChannelInterceptorList, getInterceptors, getMetricsCaptor, getOverrides, isApplicationRunning, isLoggingEnabled, isObserved, onInit, registerMetricsCaptor, registerObservationRegistry, send, send, setDatatypes, setLoggingEnabled, setMessageConverter, setObservationConvention, setShouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetManagedName, getManagedType, getThisAs, setManagedName, setManagedTypeMethods inherited from interface org.springframework.messaging.support.InterceptableChannelgetInterceptorsMethods inherited from interface org.springframework.messaging.MessageChannelsend, sendMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
AbstractPollableChannelpublic AbstractPollableChannel()
 
- 
- 
Method Details- 
getIntegrationPatternTypeDescription copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
- getIntegrationPatternTypein interface- IntegrationPattern
- Overrides:
- getIntegrationPatternTypein class- AbstractMessageChannel
- Returns:
- the IntegrationPatternTypethis component implements.
 
- 
receiveReceive the first available message from this channel. If the channel contains no messages, this method will block.- Specified by:
- receivein interface- PollableChannel
- Returns:
- the first available message or nullif the receiving thread is interrupted.
 
- 
receiveReceive the first available message from this channel. If the channel contains no messages, this method will block until the allotted timeout elapses. If the specified timeout is 0, the method will return immediately. If less than zero, it will block indefinitely (seereceive()).- Specified by:
- receivein interface- PollableChannel
- Parameters:
- timeout- the timeout in milliseconds
- Returns:
- the first available message or nullif no message is available within the allotted time or the receiving thread is interrupted.
 
- 
setInterceptorsDescription copied from class:AbstractMessageChannelSet the list of channel interceptors. This will clear any existing interceptors.- Specified by:
- setInterceptorsin interface- InterceptableChannel
- Overrides:
- setInterceptorsin class- AbstractMessageChannel
- Parameters:
- interceptors- The list of interceptors.
 
- 
addInterceptorDescription copied from class:AbstractMessageChannelAdd a channel interceptor to the end of the list.- Specified by:
- addInterceptorin interface- InterceptableChannel
- Overrides:
- addInterceptorin class- AbstractMessageChannel
- Parameters:
- interceptor- The interceptor.
 
- 
addInterceptorDescription copied from class:AbstractMessageChannelAdd a channel interceptor to the specified index of the list.- Specified by:
- addInterceptorin interface- InterceptableChannel
- Overrides:
- addInterceptorin class- AbstractMessageChannel
- Parameters:
- index- The index to add interceptor.
- interceptor- The interceptor.
 
- 
removeInterceptor- Specified by:
- removeInterceptorin interface- InterceptableChannel
- Overrides:
- removeInterceptorin class- AbstractMessageChannel
 
- 
removeInterceptor- Specified by:
- removeInterceptorin interface- InterceptableChannel
- Overrides:
- removeInterceptorin class- AbstractMessageChannel
 
- 
hasExecutorInterceptorspublic boolean hasExecutorInterceptors()- Specified by:
- hasExecutorInterceptorsin interface- ExecutorChannelInterceptorAware
 
- 
doReceiveSubclasses must implement this method. A non-negative timeout indicates how long to wait if the channel is empty (if the value is 0, it must return immediately with or without success). A negative timeout value indicates that the method should block until either a message is available or the blocking thread is interrupted.- Parameters:
- timeout- The timeout.
- Returns:
- The message, or null.
 
 
-