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.
- Since:
- 1.5.0
-
Field Summary
Fields inherited from class org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidwaitForNewMessages(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:AbstractMonitoringStrategyTemplate method that blocks until new messages arrive in the given folder. Typical implementations useThread.sleep(long)or the IMAP IDLE command.- Specified by:
waitForNewMessagesin classAbstractMonitoringStrategy- Parameters:
folder- the folder to monitor- Throws:
jakarta.mail.MessagingException- in case of JavaMail errorsInterruptedException- when a thread is interrupted
-