public class PollingConsumer extends AbstractPollingEndpoint implements IntegrationConsumer
MessageHandler
implementation
to a PollableChannel
.lifecycleCondition, lifecycleLock
EXPRESSION_PARSER, logger
Constructor and Description |
---|
PollingConsumer(org.springframework.messaging.PollableChannel inputChannel,
org.springframework.messaging.MessageHandler handler) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Subclasses must implement this method with the start behavior.
|
protected void |
doStop()
Subclasses must implement this method with the stop behavior.
|
org.springframework.messaging.MessageHandler |
getHandler()
Return the consumer's handler.
|
org.springframework.messaging.MessageChannel |
getInputChannel()
Return the input channel.
|
org.springframework.messaging.MessageChannel |
getOutputChannel()
Return the output channel (may be null).
|
protected java.lang.String |
getResourceKey()
Return the key under which the resource will be made available as an
attribute on the
IntegrationResourceHolder . |
protected java.lang.Object |
getResourceToBind()
Return a resource (MessageSource etc) to bind when using transaction
synchronization.
|
protected void |
handleMessage(org.springframework.messaging.Message<?> message)
Handle a message.
|
protected org.springframework.messaging.Message<?> |
receiveMessage()
Obtain the next message (if one is available).
|
void |
setReceiveTimeout(long receiveTimeout) |
applyReceiveOnlyAdviceChain, getBeanClassLoader, getDefaultErrorChannel, getTaskExecutor, isReceiveOnlyAdvice, isSyncExecutor, onInit, setAdviceChain, setBeanClassLoader, setErrorHandler, setMaxMessagesPerPoll, setTaskExecutor, setTransactionSynchronizationFactory, setTrigger
destroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stop
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName, getComponentType
public PollingConsumer(org.springframework.messaging.PollableChannel inputChannel, org.springframework.messaging.MessageHandler handler)
public void setReceiveTimeout(long receiveTimeout)
public org.springframework.messaging.MessageChannel getInputChannel()
IntegrationConsumer
getInputChannel
in interface IntegrationConsumer
public org.springframework.messaging.MessageChannel getOutputChannel()
IntegrationConsumer
getOutputChannel
in interface IntegrationConsumer
public org.springframework.messaging.MessageHandler getHandler()
IntegrationConsumer
getHandler
in interface IntegrationConsumer
protected void doStart()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStart
in class AbstractPollingEndpoint
protected void doStop()
AbstractEndpoint
AbstractEndpoint.lifecycleLock
.doStop
in class AbstractPollingEndpoint
protected void handleMessage(org.springframework.messaging.Message<?> message)
AbstractPollingEndpoint
handleMessage
in class AbstractPollingEndpoint
message
- The message.protected org.springframework.messaging.Message<?> receiveMessage()
AbstractPollingEndpoint
receiveMessage
in class AbstractPollingEndpoint
protected java.lang.Object getResourceToBind()
AbstractPollingEndpoint
getResourceToBind
in class AbstractPollingEndpoint
protected java.lang.String getResourceKey()
AbstractPollingEndpoint
IntegrationResourceHolder
. The default
ExpressionEvaluatingTransactionSynchronizationProcessor
makes this attribute available as a variable in SpEL expressions.getResourceKey
in class AbstractPollingEndpoint