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 MailboxFactory
Exception
public static JAMailboxFactory newMailboxFactory(int threadCount)
threadCount
- The number of concurrent to be used.public ThreadManager getThreadManager()
getThreadManager
in interface MailboxFactory
public void close()
close
in interface MailboxFactory
public final Mailbox createMailbox()
createMailbox
in interface MailboxFactory
public final Mailbox createAsyncMailbox()
createAsyncMailbox
in interface MailboxFactory
public void eventException(Request request, Exception exception)
eventException
in interface MailboxFactory
public void logException(boolean fatal, String msg, Exception exception)
logException
in interface MailboxFactory
Copyright © 2012. All Rights Reserved.