public abstract class AbstractPollableChannel extends AbstractMessageChannel implements org.springframework.messaging.PollableChannel, PollableChannelManagement, ExecutorChannelInterceptorAware
AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
interceptors
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
AbstractPollableChannel() |
Modifier and Type | Method and Description |
---|---|
void |
addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list.
|
void |
addInterceptor(int index,
org.springframework.messaging.support.ChannelInterceptor interceptor)
Add a channel interceptor to the specified index of the list.
|
protected abstract org.springframework.messaging.Message<?> |
doReceive(long timeout)
Subclasses must implement this method.
|
int |
getReceiveCount() |
long |
getReceiveCountLong() |
int |
getReceiveErrorCount() |
long |
getReceiveErrorCountLong() |
boolean |
hasExecutorInterceptors() |
org.springframework.messaging.Message<?> |
receive()
Receive the first available message from this channel.
|
org.springframework.messaging.Message<?> |
receive(long timeout)
Receive the first available message from this channel.
|
boolean |
removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
Remove the provided
ChannelInterceptor from the target implementation. |
org.springframework.messaging.support.ChannelInterceptor |
removeInterceptor(int index)
Remove a
ChannelInterceptor from the target implementation for specific index. |
void |
setInterceptors(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
Set the list of channel interceptors.
|
configureMetrics, doSend, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMetricsCaptor, getMinSendDuration, getOverrides, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onInit, registerMetricsCaptor, reset, send, send, setCountsEnabled, setDatatypes, setLoggingEnabled, setMessageConverter, setShouldTrack, setStatsEnabled
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, 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
getErrorRate, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMinSendDuration, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend
isStatsEnabled, setStatsEnabled
getOverrides, isCountsEnabled, isLoggingEnabled, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled
getChannelInterceptors
getComponentName
public int getReceiveCount()
getReceiveCount
in interface PollableChannelManagement
public long getReceiveCountLong()
getReceiveCountLong
in interface PollableChannelManagement
public int getReceiveErrorCount()
getReceiveErrorCount
in interface PollableChannelManagement
public long getReceiveErrorCountLong()
getReceiveErrorCountLong
in interface PollableChannelManagement
@Nullable public org.springframework.messaging.Message<?> receive()
receive
in interface org.springframework.messaging.PollableChannel
null
if the
receiving thread is interrupted.@Nullable public org.springframework.messaging.Message<?> receive(long timeout)
receive()
).receive
in interface org.springframework.messaging.PollableChannel
timeout
- the timeout in millisecondsnull
if no message
is available within the allotted time or the receiving thread is
interrupted.public void setInterceptors(java.util.List<org.springframework.messaging.support.ChannelInterceptor> interceptors)
AbstractMessageChannel
setInterceptors
in interface ChannelInterceptorAware
setInterceptors
in class AbstractMessageChannel
interceptors
- The list of interceptors.public void addInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
AbstractMessageChannel
addInterceptor
in interface ChannelInterceptorAware
addInterceptor
in class AbstractMessageChannel
interceptor
- The interceptor.public void addInterceptor(int index, org.springframework.messaging.support.ChannelInterceptor interceptor)
AbstractMessageChannel
addInterceptor
in interface ChannelInterceptorAware
addInterceptor
in class AbstractMessageChannel
index
- The index to add interceptor.interceptor
- The interceptor.public boolean removeInterceptor(org.springframework.messaging.support.ChannelInterceptor interceptor)
ChannelInterceptorAware
ChannelInterceptor
from the target implementation.removeInterceptor
in interface ChannelInterceptorAware
removeInterceptor
in class AbstractMessageChannel
interceptor
- ChannelInterceptor
to remove.boolean
if ChannelInterceptor
has been removed.public org.springframework.messaging.support.ChannelInterceptor removeInterceptor(int index)
ChannelInterceptorAware
ChannelInterceptor
from the target implementation for specific index.removeInterceptor
in interface ChannelInterceptorAware
removeInterceptor
in class AbstractMessageChannel
index
- the index for the ChannelInterceptor
to remove.boolean
if the ChannelInterceptor
has been removed.public boolean hasExecutorInterceptors()
hasExecutorInterceptors
in interface ExecutorChannelInterceptorAware
protected abstract org.springframework.messaging.Message<?> doReceive(long timeout)
timeout
- The timeout.