org.springframework.integration.adapter.mail.monitor
Class ImapIdleMonitoringStrategy

java.lang.Object
  extended by org.springframework.integration.adapter.mail.monitor.AbstractMonitoringStrategy
      extended by org.springframework.integration.adapter.mail.monitor.ImapIdleMonitoringStrategy
All Implemented Interfaces:
AsyncMonitoringStrategy, MonitoringStrategy

public class ImapIdleMonitoringStrategy
extends AbstractMonitoringStrategy
implements AsyncMonitoringStrategy

Implementation of the MonitoringStrategy interface that uses the IMAP IDLE command for asynchronous message detection.

Note that this implementation is only suitable for use with IMAP servers which support the IDLE command. Additionally, this strategy requires JavaMail version 1.4.1.

Author:
Arjen Poutsma

Field Summary
private  javax.mail.event.MessageCountListener messageCountListener
           
 
Fields inherited from class org.springframework.integration.adapter.mail.monitor.AbstractMonitoringStrategy
logger
 
Constructor Summary
ImapIdleMonitoringStrategy()
           
 
Method Summary
private  void createMessageCountListener()
           
 void waitForNewMessages(javax.mail.Folder folder)
           
 
Methods inherited from class org.springframework.integration.adapter.mail.monitor.AbstractMonitoringStrategy
deleteMessages, fetchMessages, getFolderOpenMode, receive, searchForNewMessages, setDeleteMessages, setMaxMessagePerDownload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageCountListener

private javax.mail.event.MessageCountListener messageCountListener
Constructor Detail

ImapIdleMonitoringStrategy

public ImapIdleMonitoringStrategy()
Method Detail

waitForNewMessages

public void waitForNewMessages(javax.mail.Folder folder)
                        throws javax.mail.MessagingException,
                               java.lang.InterruptedException
Specified by:
waitForNewMessages in interface AsyncMonitoringStrategy
Throws:
javax.mail.MessagingException
java.lang.InterruptedException

createMessageCountListener

private void createMessageCountListener()