Class ImapIdleMonitoringStrategy
java.lang.Object
org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
org.springframework.ws.transport.mail.monitor.ImapIdleMonitoringStrategy
- All Implemented Interfaces:
MonitoringStrategy
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.
- Since:
- 1.5.0
- Author:
- Arjen Poutsma
-
Field Summary
Fields inherited from class org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
waitForNewMessages
(jakarta.mail.Folder folder) Template method that blocks until new messages arrive in the given folder.Methods inherited from class org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
deleteMessages, fetchMessages, getFolderOpenMode, monitor, searchForNewMessages, setDeleteMessages
-
Constructor Details
-
ImapIdleMonitoringStrategy
public ImapIdleMonitoringStrategy()
-
-
Method Details
-
waitForNewMessages
protected void waitForNewMessages(jakarta.mail.Folder folder) throws jakarta.mail.MessagingException, InterruptedException Description copied from class:AbstractMonitoringStrategy
Template method that blocks until new messages arrive in the given folder. Typical implementations useThread.sleep(long)
or the IMAP IDLE command.- Specified by:
waitForNewMessages
in classAbstractMonitoringStrategy
- Parameters:
folder
- the folder to monitor- Throws:
jakarta.mail.MessagingException
- in case of JavaMail errorsInterruptedException
- when a thread is interrupted
-