public class Rendezvous<Msg extends Serializable> extends UnicastRemoteObject
Modifier and Type | Field and Description |
---|---|
protected Msg |
msg |
protected boolean |
open |
ref
Modifier | Constructor and Description |
---|---|
protected |
Rendezvous(Class<Msg> msgClass) |
Modifier and Type | Method and 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 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.
|
static <Msg extends Serializable> |
create()
A new Rendezvous for messages of unchecked type.
|
static <Msg extends Serializable> |
create(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(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.
|
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.
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
protected Msg extends Serializable msg
protected boolean open
protected Rendezvous(Class<Msg> msgClass) throws RemoteException
RemoteException
public static <Msg extends Serializable> Rendezvous<Msg> create(Class<Msg> msgClass)
public static <Msg extends Serializable> Rendezvous<Msg> create()
public void deposit(Msg msg) throws InterruptedException, RemoteException
InterruptedException
RemoteException
public boolean deposit(Msg msg, long millis) throws InterruptedException, RemoteException
InterruptedException
RemoteException
public Msg receive() throws InterruptedException
InterruptedException
public Msg receive(long millis) throws InterruptedException
InterruptedException
public void forwardTo(Mailbox<Msg> box) throws InterruptedException, RemoteException
InterruptedException
RemoteException
public void forwardTo(List<Mailbox<Msg>> boxes) throws InterruptedException, RemoteException
Mailbox
InterruptedException
RemoteException
public void stopForwarding()
public boolean flush(long millis) throws InterruptedException
InterruptedException
public void close(long millis) throws InterruptedException
InterruptedException
public void close() throws InterruptedException
InterruptedException
public void awaitClose() throws InterruptedException
InterruptedException
public boolean awaitClose(long millis) throws InterruptedException
InterruptedException
public boolean isForwarding()
public boolean isClosed()
Mailbox
public int capacity()
protected void forward(Msg msg, long millis) throws RemoteException, InterruptedException
RemoteException
InterruptedException
protected long myWait(long limit) throws InterruptedException
InterruptedException
public Class<Msg> messageType()
Mailbox
messageType
in interface Mailbox<Msg extends Serializable>
public <T extends Serializable> Mailbox<T> checkType(Class<T> msgClass)
Mailbox
checkType
in interface Mailbox<Msg extends Serializable>