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
  • 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:
    • 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:
    • errorChannel

      public PollerSpec errorChannel(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:
    • maxMessagesPerPoll

      public PollerSpec maxMessagesPerPoll(long maxMessagesPerPoll)
      Parameters:
      maxMessagesPerPoll - the maxMessagesPerPoll to set.
      Returns:
      the spec.
      See Also:
    • 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:
    • taskExecutor

      public PollerSpec taskExecutor(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 Map<Object,String> getComponentsToRegister()
      Specified by:
      getComponentsToRegister in interface ComponentsRegistration