public class JAMailboxFactory extends Object implements MailboxFactory
Implements MailboxFactory. In general you need only one instance of MailboxFactory per program.
MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
...
} finally {
mailboxFactory.close();
}
| Constructor and Description |
|---|
JAMailboxFactory(ThreadManager threadManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stop all the threads as they complete their tasks.
|
Mailbox |
createAsyncMailbox()
Create an asynchronous mailbox.
|
Mailbox |
createMailbox()
Create a mailbox.
|
void |
eventException(Request request,
Exception exception) |
ThreadManager |
getThreadManager()
Returns the thread manager.
|
void |
logException(boolean fatal,
String msg,
Exception exception) |
static JAMailboxFactory |
newMailboxFactory(int threadCount)
Create a JAMailboxFactory
|
Timer |
timer() |
public JAMailboxFactory(ThreadManager threadManager)
public Timer timer() throws Exception
timer in interface MailboxFactoryExceptionpublic static JAMailboxFactory newMailboxFactory(int threadCount)
threadCount - The number of concurrent to be used.public ThreadManager getThreadManager()
getThreadManager in interface MailboxFactorypublic void close()
close in interface MailboxFactorypublic final Mailbox createMailbox()
createMailbox in interface MailboxFactorypublic final Mailbox createAsyncMailbox()
createAsyncMailbox in interface MailboxFactorypublic void eventException(Request request, Exception exception)
eventException in interface MailboxFactorypublic void logException(boolean fatal,
String msg,
Exception exception)
logException in interface MailboxFactoryCopyright © 2012. All Rights Reserved.