Interface MailProcessor
- All Known Implementing Classes:
MailProcessorImpl
public interface MailProcessor
The processor applies the provided
MailWorkers.
Must be used in this order
- invoke
initializeWorkers()once to initialize all workers processMail(IncomeMail, URLName)for each mail- invoke
cleanup()once after all mails have been processed to cleanup
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Calls theMailWorker.finish(MailWorkerContext)method of all workers and destroys theMailWorkerContextfo the current thread.voidCalls theMailWorker.init(MailWorkerConfig)methods of all workers and creates aMailWorkerContextfor the current thread.voidprocessMail(IncomeMail mail, jakarta.mail.URLName mailboxUrl) Applies the specified mail to all workers.
-
Method Details
-
initializeWorkers
void initializeWorkers()Calls theMailWorker.init(MailWorkerConfig)methods of all workers and creates aMailWorkerContextfor the current thread. -
cleanup
void cleanup()Calls theMailWorker.finish(MailWorkerContext)method of all workers and destroys theMailWorkerContextfo the current thread. -
processMail
Applies the specified mail to all workers.- Throws:
MailProcessingException
-