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, wait
protected Msg extends java.io.Serializable msg
protected boolean open
protected Rendezvous(java.lang.Class<Msg> msgClass) throws java.rmi.RemoteException
java.rmi.RemoteException
public 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.InterruptedException
java.rmi.RemoteException
public boolean deposit(Msg msg, long millis) throws java.lang.InterruptedException, java.rmi.RemoteException
java.lang.InterruptedException
java.rmi.RemoteException
public Msg receive() throws java.lang.InterruptedException
java.lang.InterruptedException
public Msg receive(long millis) throws java.lang.InterruptedException
java.lang.InterruptedException
public void forwardTo(Mailbox<Msg> box) throws java.lang.InterruptedException, java.rmi.RemoteException
java.lang.InterruptedException
java.rmi.RemoteException
public void forwardTo(java.util.List<Mailbox<Msg>> boxes) throws java.lang.InterruptedException, java.rmi.RemoteException
Mailbox
java.lang.InterruptedException
java.rmi.RemoteException
public void stopForwarding()
public boolean flush(long millis) throws java.lang.InterruptedException
java.lang.InterruptedException
public void close(long millis) throws java.lang.InterruptedException
java.lang.InterruptedException
public void close() throws java.lang.InterruptedException
java.lang.InterruptedException
public void awaitClose() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean awaitClose(long millis) throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean isForwarding()
public boolean isClosed()
Mailbox
public int capacity()
protected void forward(Msg msg, long millis) throws java.rmi.RemoteException, java.lang.InterruptedException
java.rmi.RemoteException
java.lang.InterruptedException
protected long myWait(long limit) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Class<Msg> messageType()
Mailbox
messageType
in interface Mailbox<Msg extends java.io.Serializable>