Class MailStoreMonitor

All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager

A component that opens mail stores and monitors mail folders for mails.

After establishing a connection to a store and selected folders (see onOpenMailMonitor(OpenMailMonitor, Channel)), the existing and all subsequently arriving mails will be sent downstream using FoldersUpdated events.

This implementation uses the IdleManager. The IdleManager works only if its IdleManager.watch(jakarta.mail.Folder) method is invoked (for a folder) after any operation on that folder. Note that operations such as e.g. setting the deleted flag of a message is also an operation on a folder.

Folders are updated in response to an UpdateFolders event or when the store signals the arrival of new messages. Information about the folders is delivered by a FoldersUpdated event. Folders may be freely used while handling the event, because the folders will be re-registered with the IdleManager when the FoldersUpdated event completes. Any usage of folders independent of handling the events mentioned will result in a loss of the monitor function.

If required, the monitor function may be reestablished any time by firing a UpdateFolders event for the folders used.