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:
org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
PollingConsumer, SourcePollingChannelAdapter

public abstract class AbstractPollingEndpoint
extends AbstractEndpoint
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.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()
           
 void setAdviceChain(java.util.List<org.aopalliance.aop.Advice> adviceChain)
           
 void setBeanClassLoader(java.lang.ClassLoader classLoader)
           
 void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)
           
 void setMaxMessagesPerPoll(int maxMessagesPerPoll)
          Set the maximum number of messages to receive for each poll.
 void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
           
 void setTransactionDefinition(org.springframework.transaction.TransactionDefinition transactionDefinition)
           
 void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
          Specify a transaction manager to use for all polling operations.
 void setTrigger(org.springframework.scheduling.Trigger trigger)
           
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
afterPropertiesSet, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
getBeanFactory, getBeanName, getChannelResolver, getTaskScheduler, setBeanFactory, setBeanName, toString
 
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(org.springframework.scheduling.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(org.springframework.core.task.TaskExecutor taskExecutor)

setErrorHandler

public void setErrorHandler(org.springframework.util.ErrorHandler errorHandler)

setTransactionManager

public void setTransactionManager(org.springframework.transaction.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(org.springframework.transaction.TransactionDefinition transactionDefinition)

setBeanClassLoader

public void setBeanClassLoader(java.lang.ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware

setAdviceChain

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

onInit

protected void onInit()
Overrides:
onInit in class AbstractEndpoint

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()