|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.server.RemoteObject java.rmi.server.RemoteServer java.rmi.server.UnicastRemoteObject ucb.util.mailbox.Rendezvous<Msg>
public class Rendezvous<Msg extends Serializable>
A Mailbox with a capacity of 0. A depositer must wait until his message is received.
Field Summary | |
---|---|
protected Msg |
msg
|
protected boolean |
open
|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
protected |
Rendezvous(Class<Msg> msgClass)
|
Method Summary | ||
---|---|---|
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. |
|
|
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
|
create()
A new Rendezvous for messages of unchecked type. |
|
static
|
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. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Msg extends Serializable msg
protected boolean open
Constructor Detail |
---|
protected Rendezvous(Class<Msg> msgClass) throws RemoteException
RemoteException
Method Detail |
---|
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>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |