org.springframework.integration.mail
Class ImapIdleChannelAdapter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.MessageProducerSupport
              extended by org.springframework.integration.mail.ImapIdleChannelAdapter
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle

public class ImapIdleChannelAdapter
extends MessageProducerSupport

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

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
ImapIdleChannelAdapter(ImapMailReceiver mailReceiver)
           
 
Method Summary
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 handleMailMessagingException(javax.mail.MessagingException e)
           
 void setShouldReconnectAutomatically(boolean shouldReconnectAutomatically)
          Specify whether the IDLE task should reconnect automatically after catching a FolderClosedException while waiting for messages.
 void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
           
 
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
onInit, sendMessage, setOutputChannel, setSendTimeout
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
afterPropertiesSet, isRunning, setAutoStartup, setTaskScheduler, start, 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
 

Constructor Detail

ImapIdleChannelAdapter

public ImapIdleChannelAdapter(ImapMailReceiver mailReceiver)
Method Detail

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.


setTaskExecutor

public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)

handleMailMessagingException

protected void handleMailMessagingException(javax.mail.MessagingException e)

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