Class PollingConsumer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.AbstractPollingEndpoint
org.springframework.integration.endpoint.PollingConsumer
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ComponentSourceAware,- ExpressionCapable,- IntegrationConsumer,- NamedComponent,- ManageableLifecycle,- ManageableSmartLifecycle
Message Endpoint that connects any 
MessageHandler implementation
 to a PollableChannel.- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longA default receive timeout as 1000L milliseconds.Fields inherited from class org.springframework.integration.endpoint.AbstractPollingEndpointDEFAULT_POLLING_PERIODFields inherited from class org.springframework.integration.endpoint.AbstractEndpointlifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoStart()Subclasses must implement this method with the start behavior.protected voiddoStop()Subclasses must implement this method with the stop behavior.Return the consumer's handler.Return the input channel.Return the output channel (maybe null).protected Objectprotected StringReturn the key under which the resource will be made available as an attribute on theIntegrationResourceHolder.protected ObjectReturn a resource (MessageSource etc.) to bind when using transaction synchronization.protected voidhandleMessage(Message<?> message) Handle a message.protected booleanprotected Message<?> Obtain the next message (if one is available).protected voidsetReceiveMessageSource(Object source) voidsetReceiveTimeout(long receiveTimeout) Methods inherited from class org.springframework.integration.endpoint.AbstractPollingEndpointapplyReceiveOnlyAdviceChain, donePollingTask, getBeanClassLoader, getDefaultErrorChannel, getMaxMessagesPerPoll, getPollingFlux, getTaskExecutor, isReceiveOnlyAdvice, isSyncExecutor, messageReceived, onInit, setAdviceChain, setBeanClassLoader, setErrorHandler, setMaxMessagesPerPoll, setTaskExecutor, setTransactionSynchronizationFactory, setTriggerMethods inherited from class org.springframework.integration.endpoint.AbstractEndpointdestroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getComponentType, 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.context.NamedComponentgetBeanName, getComponentName, getComponentType
- 
Field Details- 
DEFAULT_RECEIVE_TIMEOUTpublic static final long DEFAULT_RECEIVE_TIMEOUTA default receive timeout as 1000L milliseconds.- See Also:
 
 
- 
- 
Constructor Details- 
PollingConsumer
 
- 
- 
Method Details- 
setReceiveTimeoutpublic void setReceiveTimeout(long receiveTimeout) 
- 
getInputChannelDescription copied from interface:IntegrationConsumerReturn the input channel.- Specified by:
- getInputChannelin interface- IntegrationConsumer
- Returns:
- the input channel.
 
- 
getOutputChannelDescription copied from interface:IntegrationConsumerReturn the output channel (maybe null).- Specified by:
- getOutputChannelin interface- IntegrationConsumer
- Returns:
- the output channel.
 
- 
getHandlerDescription copied from interface:IntegrationConsumerReturn the consumer's handler.- Specified by:
- getHandlerin interface- IntegrationConsumer
- Returns:
- the handler.
 
- 
getReceiveMessageSource- Overrides:
- getReceiveMessageSourcein class- AbstractPollingEndpoint
 
- 
setReceiveMessageSource- Overrides:
- setReceiveMessageSourcein class- AbstractPollingEndpoint
 
- 
isReactiveprotected boolean isReactive()- Overrides:
- isReactivein class- AbstractPollingEndpoint
 
- 
doStartprotected void doStart()Description copied from class:AbstractEndpointSubclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
- doStartin class- AbstractPollingEndpoint
 
- 
doStopprotected void doStop()Description copied from class:AbstractEndpointSubclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
- doStopin class- AbstractPollingEndpoint
 
- 
handleMessageDescription copied from class:AbstractPollingEndpointHandle a message.- Specified by:
- handleMessagein class- AbstractPollingEndpoint
- Parameters:
- message- The message.
 
- 
receiveMessageDescription copied from class:AbstractPollingEndpointObtain the next message (if one is available). MAY return null if no message is immediately available.- Specified by:
- receiveMessagein class- AbstractPollingEndpoint
- Returns:
- The message or null.
 
- 
getResourceToBindDescription copied from class:AbstractPollingEndpointReturn a resource (MessageSource etc.) to bind when using transaction synchronization.- Overrides:
- getResourceToBindin class- AbstractPollingEndpoint
- Returns:
- The resource, or null if transaction synchronization is not required.
 
- 
getResourceKeyDescription copied from class:AbstractPollingEndpointReturn the key under which the resource will be made available as an attribute on theIntegrationResourceHolder. The defaultExpressionEvaluatingTransactionSynchronizationProcessormakes this attribute available as a variable in SpEL expressions.- Overrides:
- getResourceKeyin class- AbstractPollingEndpoint
- Returns:
- The key, or null (default) if the resource shouldn't be made available as a attribute.
 
 
-