|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.toolkit.Mailbox
This class implements an asynchronous mailbox.
Nested Class Summary | |
static interface |
Mailbox.Reader
General type for mail readers |
Constructor Summary | |
Mailbox()
Builds a new Mailbox . |
Method Summary | |
protected void |
finalize()
On destruction waits for all readers to finish reading any pending mail. |
static void |
main(java.lang.String[] args)
Sample mailbox test code. |
void |
post(java.lang.Object mail)
Posts one more mail |
void |
start(Mailbox.Reader reader)
Starts the event postmaster thread. |
void |
stop()
Stops the mail postmaster thread. |
void |
terminate()
Notifies the termination of the process. |
void |
waitForReaders()
Waits for all readers to have read all pending mails. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Mailbox()
Mailbox
.
Method Detail |
public void start(Mailbox.Reader reader)
public void post(java.lang.Object mail)
public void waitForReaders()
public void stop()
public void terminate()
Mailbox
to have been handled,
and then stops all mail readers.
Please understand that it is not equivalent to use to consecutives calls to
mailbox.waitForReaders(); mailbox.stop()
since this would release the
lock between the two statements whereas it should not.
protected void finalize()
Thread.stop()
finalize
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |