Spring Web Services Framework

org.springframework.ws.transport.mail.monitor
Interface MonitoringStrategy

All Known Implementing Classes:
AbstractMonitoringStrategy, ImapIdleMonitoringStrategy, PollingMonitoringStrategy, Pop3PollingMonitoringStrategy

public interface MonitoringStrategy

Defines the contract for objects that monitor a given folder for new messages. Allows for multiple implementation strategies, including polling, or event-driven techniques such as IMAP's IDLE command.

Author:
Arjen Poutsma

Method Summary
 int getFolderOpenMode()
          Returns the folder open mode to be used by this strategy.
 Message[] monitor(Folder folder)
          Monitors the given folder, and returns any new messages when they arrive.
 

Method Detail

monitor

Message[] monitor(Folder folder)
                  throws MessagingException,
                         InterruptedException
Monitors the given folder, and returns any new messages when they arrive.

Parameters:
folder - the folder in which to look for new messages
Returns:
the new messages
Throws:
MessagingException - in case of JavaMail errors
InterruptedException - if a thread is interrupted

getFolderOpenMode

int getFolderOpenMode()
Returns the folder open mode to be used by this strategy. Can be either Folder.READ_ONLY or Folder.READ_WRITE.


Spring Web Services Framework

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