public class ImapIdleMonitoringStrategy extends AbstractMonitoringStrategy
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.
logger| Constructor and Description |
|---|
ImapIdleMonitoringStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
waitForNewMessages(Folder folder)
Template method that blocks until new messages arrive in the given folder.
|
deleteMessages, fetchMessages, getFolderOpenMode, monitor, searchForNewMessages, setDeleteMessagesprotected void waitForNewMessages(Folder folder) throws MessagingException, InterruptedException
AbstractMonitoringStrategyThread.sleep(long) or the IMAP IDLE command.waitForNewMessages in class AbstractMonitoringStrategyfolder - the folder to monitorMessagingException - in case of JavaMail errorsInterruptedException - when a thread is interrupted