Package mireka.transmission.queue
Class ScheduleFileDirQueue
- Object
-
- mireka.transmission.queue.ScheduleFileDirQueue
-
public class ScheduleFileDirQueue extends ObjectThis mail queue, working with a mail store, passes the mails to a mail processors according to the schedule. The schedule is defined by the time point inMail.scheduleDatein each mail.
-
-
Constructor Summary
Constructors Constructor Description ScheduleFileDirQueue()use this constructor with settersScheduleFileDirQueue(FileDirStore store, MailProcessorFactory mailProcessorFactory, java.util.concurrent.ScheduledThreadPoolExecutor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Mail srcMail)store a copy of the mail in the queue and schedule itvoidsetExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor)voidsetMailProcessorFactory(MailProcessorFactory mailProcessorFactory)voidsetStore(FileDirStore store)voidsetThreadCount(int count)voidshutdown()Initiates an orderly shutdown, no new mails will be accepted and processing of mails which are not yet started will not be startedvoidstart()StringtoString()
-
-
-
Constructor Detail
-
ScheduleFileDirQueue
public ScheduleFileDirQueue()
use this constructor with setters
-
ScheduleFileDirQueue
public ScheduleFileDirQueue(FileDirStore store, MailProcessorFactory mailProcessorFactory, java.util.concurrent.ScheduledThreadPoolExecutor executor)
- Parameters:
executor-ScheduledThreadPoolExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(boolean)will be called on it with false, to switch off waiting for tasks which are not even started on shutdown.
-
-
Method Detail
-
start
@PostConstruct public void start()
-
add
public void add(Mail srcMail) throws QueueStorageException
store a copy of the mail in the queue and schedule it- Throws:
QueueStorageException
-
shutdown
public 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
-
setStore
public void setStore(FileDirStore store)
- Category:
- GETSET
-
setMailProcessorFactory
public void setMailProcessorFactory(MailProcessorFactory mailProcessorFactory)
- Category:
- GETSET
-
setExecutor
public void setExecutor(java.util.concurrent.ScheduledThreadPoolExecutor executor)
- Category:
- GETSET
-
setThreadCount
public void setThreadCount(int count)
- Category:
- GETSET
-
toString
public String toString()
- Overrides:
toStringin classObject
-
-