public class ScheduleFileDirQueue
extends Object
Mail.scheduleDate
in each mail.Constructor and Description |
---|
ScheduleFileDirQueue()
use this constructor with setters
|
ScheduleFileDirQueue(FileDirStore store,
MailProcessorFactory mailProcessorFactory,
java.util.concurrent.ScheduledThreadPoolExecutor executor) |
Modifier and Type | Method and Description |
---|---|
void |
add(Mail srcMail)
store a copy of the mail in the queue and schedule it
|
void |
setExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor) |
void |
setMailProcessorFactory(MailProcessorFactory mailProcessorFactory) |
void |
setStore(FileDirStore store) |
void |
setThreadCount(int count) |
void |
shutdown()
Initiates an orderly shutdown, no new mails will be accepted and
processing of mails which are not yet started will not be started
|
void |
start() |
String |
toString() |
public ScheduleFileDirQueue()
public ScheduleFileDirQueue(FileDirStore store, MailProcessorFactory mailProcessorFactory, java.util.concurrent.ScheduledThreadPoolExecutor executor)
executor
- ScheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean)
will be called on it with false, to switch off waiting for
tasks which are not even started on shutdown.@PostConstruct public void start()
public void add(Mail srcMail) throws QueueStorageException
QueueStorageException
public void shutdown()
public void setStore(FileDirStore store)
public void setMailProcessorFactory(MailProcessorFactory mailProcessorFactory)
public void setExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor)
public void setThreadCount(int count)
public String toString()
toString
in class Object