Interface MailProcessor
- All Known Implementing Classes:
MailProcessorImpl
public interface MailProcessor
The processor applies the provided
MailWorker
s.
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 TypeMethodDescriptionvoid
cleanup()
Calls theMailWorker.finish(MailWorkerContext)
method of all workers and destroys theMailWorkerContext
fo the current thread.void
Calls theMailWorker.init(MailWorkerConfig)
methods of all workers and creates aMailWorkerContext
for the current thread.void
processMail
(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 aMailWorkerContext
for the current thread. -
cleanup
void cleanup()Calls theMailWorker.finish(MailWorkerContext)
method of all workers and destroys theMailWorkerContext
fo the current thread. -
processMail
Applies the specified mail to all workers.- Throws:
MailProcessingException
-