Spring Integration

org.springframework.integration.endpoint
Class AbstractPollingEndpoint

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.AbstractPollingEndpoint
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, InitializingBean, Lifecycle, Phased, SmartLifecycle, NamedComponent
Direct Known Subclasses:
PollingConsumer, SourcePollingChannelAdapter

public abstract class AbstractPollingEndpoint
extends AbstractEndpoint
implements InitializingBean, BeanClassLoaderAware

Author:
Mark Fisher

Field Summary
static int MAX_MESSAGES_UNBOUNDED
           
protected  long maxMessagesPerPoll
           
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
AbstractPollingEndpoint()
           
 
Method Summary
protected abstract  boolean doPoll()
           
protected  void doStart()
          Subclasses must implement this method with the start behavior.
protected  void doStop()
          Subclasses must implement this method with the stop behavior.
protected  void onInit()
          Subclasses may implement this for initialization logic.
 void setAdviceChain(List<org.aopalliance.aop.Advice> adviceChain)
           
 void setBeanClassLoader(ClassLoader classLoader)
           
 void setErrorHandler(ErrorHandler errorHandler)
           
 void setMaxMessagesPerPoll(int maxMessagesPerPoll)
          Set the maximum number of messages to receive for each poll.
 void setTaskExecutor(Executor taskExecutor)
           
 void setTransactionDefinition(TransactionDefinition transactionDefinition)
           
 void setTransactionManager(PlatformTransactionManager transactionManager)
          Specify a transaction manager to use for all polling operations.
 void setTrigger(Trigger trigger)
           
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, toString, writeMessageHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 

Field Detail

MAX_MESSAGES_UNBOUNDED

public static final int MAX_MESSAGES_UNBOUNDED
See Also:
Constant Field Values

maxMessagesPerPoll

protected volatile long maxMessagesPerPoll
Constructor Detail

AbstractPollingEndpoint

public AbstractPollingEndpoint()
Method Detail

setTrigger

public void setTrigger(Trigger trigger)

setMaxMessagesPerPoll

public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
Set the maximum number of messages to receive for each poll. A non-positive value indicates that polling should repeat as long as non-null messages are being received and successfully sent.

The default is unbounded.

See Also:
MAX_MESSAGES_UNBOUNDED

setTaskExecutor

public void setTaskExecutor(Executor taskExecutor)

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)

setTransactionManager

public void setTransactionManager(PlatformTransactionManager transactionManager)
Specify a transaction manager to use for all polling operations. If none is provided, then the operations will occur without any transactional behavior (i.e. there is no default transaction manager).


setTransactionDefinition

public void setTransactionDefinition(TransactionDefinition transactionDefinition)

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

setAdviceChain

public void setAdviceChain(List<org.aopalliance.aop.Advice> adviceChain)

onInit

protected void onInit()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this for initialization logic.

Overrides:
onInit in class IntegrationObjectSupport

doStart

protected void doStart()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the start behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStart in class AbstractEndpoint

doStop

protected void doStop()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the stop behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStop in class AbstractEndpoint

doPoll

protected abstract boolean doPoll()

Spring Integration

Copyright © 2010. All Rights Reserved.