java.io.Serializable, java.rmi.Remote, Mailbox<Msg>public class Rendezvous<Msg extends java.io.Serializable>
extends java.rmi.server.UnicastRemoteObject
| Modifier | Constructor | Description |
|---|---|---|
protected |
Rendezvous(java.lang.Class<Msg> msgClass) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
awaitClose() |
Wait for THIS to be closed.
|
boolean |
awaitClose(long millis) |
Wait for THIS to be closed, or MILLIS milliseconds, whichever comes
first.
|
int |
capacity() |
The capacity (see interface comment above) of THIS.
|
<T extends java.io.Serializable> |
checkType(java.lang.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.
|
static <Msg extends java.io.Serializable> |
create() |
A new Rendezvous for messages of unchecked type.
|
static <Msg extends java.io.Serializable> |
create(java.lang.Class<Msg> msgClass) |
A new Rendezvous for messages of type MSGCLASS.
|
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 any queued message to be received, or MILLIS milliseconds,
whichever comes first.
|
protected void |
forward(Msg msg,
long millis) |
|
void |
forwardTo(java.util.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 BOXES
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.
|
java.lang.Class<Msg> |
messageType() |
The (runtime) type of message sent through this box.
|
protected long |
myWait(long limit) |
|
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.
|
finalize, getClass, notify, notifyAll, wait, wait, waitprotected Msg extends java.io.Serializable msg
protected boolean open
protected Rendezvous(java.lang.Class<Msg> msgClass) throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic static <Msg extends java.io.Serializable> Rendezvous<Msg> create(java.lang.Class<Msg> msgClass)
public static <Msg extends java.io.Serializable> Rendezvous<Msg> create()
public void deposit(Msg msg) throws java.lang.InterruptedException, java.rmi.RemoteException
java.lang.InterruptedExceptionjava.rmi.RemoteExceptionpublic boolean deposit(Msg msg, long millis) throws java.lang.InterruptedException, java.rmi.RemoteException
java.lang.InterruptedExceptionjava.rmi.RemoteExceptionpublic Msg receive() throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic Msg receive(long millis) throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void forwardTo(Mailbox<Msg> box) throws java.lang.InterruptedException, java.rmi.RemoteException
java.lang.InterruptedExceptionjava.rmi.RemoteExceptionpublic void forwardTo(java.util.List<Mailbox<Msg>> boxes) throws java.lang.InterruptedException, java.rmi.RemoteException
Mailboxjava.lang.InterruptedExceptionjava.rmi.RemoteExceptionpublic void stopForwarding()
public boolean flush(long millis)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void close(long millis)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void close()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void awaitClose()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean awaitClose(long millis)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean isForwarding()
public boolean isClosed()
Mailboxpublic int capacity()
protected void forward(Msg msg, long millis) throws java.rmi.RemoteException, java.lang.InterruptedException
java.rmi.RemoteExceptionjava.lang.InterruptedExceptionprotected long myWait(long limit)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.Class<Msg> messageType()
MailboxmessageType in interface Mailbox<Msg extends java.io.Serializable>