public interface Mailbox<Msg extends Serializable> extends Remote
Modifier and Type | Method and Description |
---|---|
int |
capacity()
The capacity (see interface comment above) of THIS.
|
<T extends Serializable> |
checkType(Class<T> msgClass)
Returns THIS, assuming that THIS conveys messages of class MSGCLASS.
|
void |
close()
Short for close (0).
|
void |
close(long millis)
Performs a flush(MILLIS) and then invalidates THIS for all future
use, deleting all remaining messages.
|
void |
deposit(Msg msg)
Deposit MSG in this Mailbox.
|
boolean |
deposit(Msg msg,
long millis)
Deposit MSG in this Mailbox, if this can be done within approximately
MILLIS milliseconds.
|
boolean |
flush(long millis)
Wait for all queued messages to be received, or MILLIS milliseconds,
whichever comes first.
|
void |
forwardTo(List<Mailbox<Msg>> boxes)
Forward copies of all messages (including any already present) to BOXES
in the order received.
|
void |
forwardTo(Mailbox<Msg> box)
Forward copies of all messages (including any already present) to BOX
in the order received.
|
boolean |
isClosed()
True iff THIS is closed.
|
boolean |
isForwarding()
True iff THIS is currently forwarding messages as a result of
forwardTo.
|
Class<Msg> |
messageType()
The (runtime) type of message sent through this box.
|
Msg |
receive()
Receive the next queued message in this Mailbox.
|
Msg |
receive(long millis)
Receive the next queued message in this Mailbox, if one is
available within MILLIS milliseconds.
|
void |
stopForwarding()
Stop forwarding copies of messages.
|
void deposit(Msg msg) throws RemoteException, InterruptedException
RemoteException
InterruptedException
boolean deposit(Msg msg, long millis) throws RemoteException, InterruptedException
RemoteException
InterruptedException
Msg receive() throws RemoteException, InterruptedException
RemoteException
InterruptedException
Msg receive(long millis) throws RemoteException, InterruptedException
RemoteException
InterruptedException
void forwardTo(Mailbox<Msg> box) throws RemoteException, InterruptedException
RemoteException
InterruptedException
void forwardTo(List<Mailbox<Msg>> boxes) throws RemoteException, InterruptedException
RemoteException
InterruptedException
void stopForwarding() throws RemoteException
RemoteException
boolean flush(long millis) throws RemoteException, InterruptedException
RemoteException
InterruptedException
void close(long millis) throws RemoteException, InterruptedException
RemoteException
InterruptedException
void close() throws RemoteException, InterruptedException
RemoteException
InterruptedException
boolean isForwarding() throws RemoteException
RemoteException
boolean isClosed() throws RemoteException
RemoteException
int capacity() throws RemoteException
RemoteException
Class<Msg> messageType() throws RemoteException
RemoteException
<T extends Serializable> Mailbox<T> checkType(Class<T> msgClass) throws RemoteException
RemoteException