Class ImapIdleChannelAdapter

All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, ExpressionCapable, MessageProducer, IntegrationPattern, NamedComponent, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent

public class ImapIdleChannelAdapter extends MessageProducerSupport implements BeanClassLoaderAware, ApplicationEventPublisherAware
An event-driven Channel Adapter that receives mail messages from a mail server that supports the IMAP "idle" command (see RFC 2177). Received mail messages will be converted and sent as Spring Integration Messages to the output channel. The Message payload will be the Message instance that was received.
Author:
Arjen Poutsma, Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan
  • Constructor Details

    • ImapIdleChannelAdapter

      public ImapIdleChannelAdapter(ImapMailReceiver mailReceiver)
  • Method Details

    • setTransactionSynchronizationFactory

      public void setTransactionSynchronizationFactory(TransactionSynchronizationFactory transactionSynchronizationFactory)
    • setAdviceChain

      public void setAdviceChain(List<Advice> adviceChain)
    • setSendingTaskExecutor

      public void setSendingTaskExecutor(Executor sendingTaskExecutor)
      Specify an Executor used to send messages received by the adapter.
      Parameters:
      sendingTaskExecutor - the sendingTaskExecutor to set
    • setShouldReconnectAutomatically

      public void setShouldReconnectAutomatically(boolean shouldReconnectAutomatically)
      Specify whether the IDLE task should reconnect automatically after catching a FolderClosedException while waiting for messages. The default value is true.
      Parameters:
      shouldReconnectAutomatically - true to reconnect.
    • setReconnectDelay

      public void setReconnectDelay(long reconnectDelay)
      The time between connection attempts in milliseconds (default 10 seconds).
      Parameters:
      reconnectDelay - the reconnectDelay to set
      Since:
      3.0.5
    • getComponentType

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class IntegrationObjectSupport
    • setBeanClassLoader

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

      public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface ApplicationEventPublisherAware
    • doStart

      protected void doStart()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior. Protected by 'lifecycleLock'.
      Overrides:
      doStart in class MessageProducerSupport
    • doStop

      protected void doStop()
      Description copied from class: MessageProducerSupport
      Take no action by default. Subclasses may override this if they need lifecycle-managed behavior.
      Overrides:
      doStop in class MessageProducerSupport
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean
      Overrides:
      destroy in class AbstractEndpoint