|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A repository for messages, suitable for remote use. Has facilities for forwarding copies of messages to other mailboxes. Messages are received and forwarded in the order deposited. A mailbox has a "capacity", which is the maximum allowed excess of completed deposits over completely processed messages. A message is "completely" processed when it has been received (if retains() is true) and has been forwarded to all requesters. Thus, when a Mailbox has a capacity of 0, it synchronizes senders and receivers: a deposit does not complete until its message is picked up by receive (and forwarded, if called for).
| Method Summary | |
int |
capacity()
The capacity (see interface comment above) of THIS. |
void |
close()
Delete any pending messages and then invalidate this Mailbox, so that further use causes an exception. |
int |
concurrency()
The level of concurrency for forwarding: 0 means mail is forwarded before deposit finishes; n>0 mean that n separate daemon threads deliver forwarded mail. |
void |
deposit(java.io.Serializable msg)
Deposit MSG in this Mailbox. |
boolean |
depositIfPossible(java.io.Serializable msg)
Deposit MSG in this Mailbox, if it is not full. |
void |
flush()
Wait until all pending messages have been received. |
void |
forwardTo(Mailbox box,
boolean forwardCurrent)
Begin forwarding copies of all messages to BOX in the order received. |
java.io.Serializable |
receive()
Receive the next queued message in this Mailbox. |
java.io.Serializable |
receiveIfPossible()
Receive the next queued message in this Mailbox, if one is immediately available. |
boolean |
retains()
True iff this Mailbox retains messages sent to it for later receipt. |
void |
stopForwardingTo(Mailbox box)
Stop forwarding copies of messages to BOX. |
| Method Detail |
public void deposit(java.io.Serializable msg)
throws java.rmi.RemoteException,
java.lang.InterruptedException
public boolean depositIfPossible(java.io.Serializable msg)
throws java.rmi.RemoteException,
java.lang.InterruptedException
public java.io.Serializable receive()
throws java.rmi.RemoteException,
java.lang.InterruptedException
public java.io.Serializable receiveIfPossible()
throws java.rmi.RemoteException,
java.lang.InterruptedException
public void forwardTo(Mailbox box,
boolean forwardCurrent)
throws java.rmi.RemoteException,
java.lang.InterruptedException
public void stopForwardingTo(Mailbox box)
throws java.rmi.RemoteException
public void flush()
throws java.rmi.RemoteException,
java.lang.InterruptedException
public void close()
throws java.rmi.RemoteException,
java.lang.InterruptedException
public boolean retains()
throws java.rmi.RemoteException
public int concurrency()
throws java.rmi.RemoteException
public int capacity()
throws java.rmi.RemoteException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||