Class PollerSpec

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<PollerMetadata>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, ComponentsRegistration

public final class PollerSpec
extends IntegrationComponentSpec<PollerSpec,​PollerMetadata>
implements ComponentsRegistration
Since:
5.0
  • Field Summary

    Fields inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    PARSER, target

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Method Summary

    Modifier and Type Method Description
    PollerSpec advice​(org.aopalliance.aop.Advice... advice)
    Specify AOP Advices for the pollingTask.
    PollerSpec errorChannel​(java.lang.String errorChannelName)
    Specify a bean name for the MessageChannel to use for sending error message in case of polling failures.
    PollerSpec errorChannel​(org.springframework.messaging.MessageChannel errorChannel)
    Specify a MessageChannel to use for sending error message in case of polling failures.
    PollerSpec errorHandler​(org.springframework.util.ErrorHandler errorHandler)
    Specify the ErrorHandler to wrap a taskExecutor to the ErrorHandlingTaskExecutor.
    java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()  
    PollerSpec maxMessagesPerPoll​(long maxMessagesPerPoll)  
    PollerSpec receiveTimeout​(long receiveTimeout)
    Specify a timeout in milliseconds to wait for a message in the MessageChannel.
    PollerSpec sendTimeout​(long sendTimeout)  
    PollerSpec taskExecutor​(java.util.concurrent.Executor taskExecutor)
    Specify an Executor to perform the pollingTask.
    PollerSpec transactional()
    Specify a TransactionInterceptor Advice with default PlatformTransactionManager and DefaultTransactionAttribute for the pollingTask.
    PollerSpec transactional​(org.springframework.transaction.interceptor.TransactionInterceptor transactionInterceptor)
    Specify a TransactionInterceptor Advice for the pollingTask.
    PollerSpec transactional​(org.springframework.transaction.TransactionManager transactionManager)
    Specify a TransactionInterceptor Advice with the provided PlatformTransactionManager and default DefaultTransactionAttribute for the pollingTask.
    PollerSpec transactionSynchronizationFactory​(TransactionSynchronizationFactory transactionSynchronizationFactory)
    Specify the TransactionSynchronizationFactory to attach a TransactionSynchronization to the transaction around poll operation.

    Methods inherited from class org.springframework.integration.dsl.IntegrationComponentSpec

    _this, createInstance, destroyInstance, doGet, get, getId, getObjectType, getPhase, id, isAutoStartup, isRunning, start, stop, stop

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • transactionSynchronizationFactory

      public PollerSpec transactionSynchronizationFactory​(TransactionSynchronizationFactory transactionSynchronizationFactory)
      Specify the TransactionSynchronizationFactory to attach a TransactionSynchronization to the transaction around poll operation.
      Parameters:
      transactionSynchronizationFactory - the TransactionSynchronizationFactory to use.
      Returns:
      the spec.
    • errorHandler

      public PollerSpec errorHandler​(org.springframework.util.ErrorHandler errorHandler)
      Specify the ErrorHandler to wrap a taskExecutor to the ErrorHandlingTaskExecutor.
      Parameters:
      errorHandler - the ErrorHandler to use.
      Returns:
      the spec.
      See Also:
      taskExecutor(Executor)
    • errorChannel

      public PollerSpec errorChannel​(org.springframework.messaging.MessageChannel errorChannel)
      Specify a MessageChannel to use for sending error message in case of polling failures.
      Parameters:
      errorChannel - the MessageChannel to use.
      Returns:
      the spec.
      See Also:
      MessagePublishingErrorHandler
    • errorChannel

      public PollerSpec errorChannel​(java.lang.String errorChannelName)
      Specify a bean name for the MessageChannel to use for sending error message in case of polling failures.
      Parameters:
      errorChannelName - the bean name for MessageChannel to use.
      Returns:
      the spec.
      See Also:
      MessagePublishingErrorHandler
    • maxMessagesPerPoll

      public PollerSpec maxMessagesPerPoll​(long maxMessagesPerPoll)
      Parameters:
      maxMessagesPerPoll - the maxMessagesPerPoll to set.
      Returns:
      the spec.
      See Also:
      PollerMetadata.setMaxMessagesPerPoll(long)
    • receiveTimeout

      public PollerSpec receiveTimeout​(long receiveTimeout)
      Specify a timeout in milliseconds to wait for a message in the MessageChannel. Defaults to 1000.
      Parameters:
      receiveTimeout - the timeout to use.
      Returns:
      the spec.
      See Also:
      PollableChannel.receive(long)
    • advice

      public PollerSpec advice​(org.aopalliance.aop.Advice... advice)
      Specify AOP Advices for the pollingTask.
      Parameters:
      advice - the Advices to use.
      Returns:
      the spec.
    • transactional

      public PollerSpec transactional​(org.springframework.transaction.TransactionManager transactionManager)
      Specify a TransactionInterceptor Advice with the provided PlatformTransactionManager and default DefaultTransactionAttribute for the pollingTask.
      Parameters:
      transactionManager - the TransactionManager to use.
      Returns:
      the spec.
    • transactional

      public PollerSpec transactional()
      Specify a TransactionInterceptor Advice with default PlatformTransactionManager and DefaultTransactionAttribute for the pollingTask.
      Returns:
      the spec.
    • transactional

      public PollerSpec transactional​(org.springframework.transaction.interceptor.TransactionInterceptor transactionInterceptor)
      Specify a TransactionInterceptor Advice for the pollingTask.
      Parameters:
      transactionInterceptor - the TransactionInterceptor to use.
      Returns:
      the spec.
      See Also:
      TransactionInterceptorBuilder
    • taskExecutor

      public PollerSpec taskExecutor​(java.util.concurrent.Executor taskExecutor)
      Specify an Executor to perform the pollingTask.
      Parameters:
      taskExecutor - the Executor to use.
      Returns:
      the spec.
    • sendTimeout

      public PollerSpec sendTimeout​(long sendTimeout)
    • getComponentsToRegister

      public java.util.Map<java.lang.Object,​java.lang.String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface ComponentsRegistration