Spring Web Services Framework

org.springframework.ws.transport.mail.monitor
Class ImapIdleMonitoringStrategy

java.lang.Object
  extended by org.springframework.ws.transport.mail.monitor.AbstractMonitoringStrategy
      extended by org.springframework.ws.transport.mail.monitor.ImapIdleMonitoringStrategy
All Implemented Interfaces:
MonitoringStrategy

public class ImapIdleMonitoringStrategy
extends AbstractMonitoringStrategy

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
ImapIdleMonitoringStrategy()
           
 
Method Summary
protected  void waitForNewMessages(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImapIdleMonitoringStrategy

public ImapIdleMonitoringStrategy()
Method Detail

waitForNewMessages

protected void waitForNewMessages(Folder folder)
                           throws MessagingException,
                                  InterruptedException
Description copied from class: AbstractMonitoringStrategy
Template method that blocks until new messages arrive in the given folder. Typical implementations use Thread.sleep(long) or the IMAP IDLE command.

Specified by:
waitForNewMessages in class AbstractMonitoringStrategy
Parameters:
folder - the folder to monitor
Throws:
MessagingException - in case of JavaMail errors
InterruptedException - when a thread is interrupted

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.