org.springframework.integration.adapter.mail.monitor
Class ImapIdleMonitoringStrategy
java.lang.Object
org.springframework.integration.adapter.mail.monitor.AbstractMonitoringStrategy
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
messageCountListener
private javax.mail.event.MessageCountListener messageCountListener
ImapIdleMonitoringStrategy
public ImapIdleMonitoringStrategy()
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()