Package ucb.util.mailbox
Class SinkBox<Msg extends Serializable>
- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- ucb.util.mailbox.QueuedMailbox<Msg>
-
- ucb.util.mailbox.SinkBox<Msg>
-
- All Implemented Interfaces:
Serializable
,Remote
,Mailbox<Msg>
public class SinkBox<Msg extends Serializable> extends QueuedMailbox<Msg>
A Mailbox that throws away all mail (after any forwarding).- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ucb.util.mailbox.QueuedMailbox
capacity, depositBlocks, open, queue
-
Fields inherited from class java.rmi.server.RemoteObject
ref
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Serializable>
Mailbox<T>checkType(Class<T> msgClass)
Returns THIS, assuming that THIS conveys messages of class MSGCLASS.static <Msg extends Serializable>
SinkBox<Msg>create()
A new SinkBox with no type checking.static <Msg extends Serializable>
SinkBox<Msg>create(Class<Msg> msgClass)
A new SinkBox for messages of type MSGCLASS.protected void
enqueue(Msg msg)
Place MSG at the end of the message queue.Class<Msg>
messageType()
The (runtime) type of message sent through this box.-
Methods inherited from class ucb.util.mailbox.QueuedMailbox
capacity, close, close, create, create, deposit, deposit, flush, forward, forwardTo, forwardTo, isClosed, isForwarding, myWait, receive, receive, stopForwarding
-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
-
-
-
Constructor Detail
-
SinkBox
protected SinkBox(Class<Msg> msgClass) throws RemoteException
- Throws:
RemoteException
-
-
Method Detail
-
create
public static <Msg extends Serializable> SinkBox<Msg> create(Class<Msg> msgClass)
A new SinkBox for messages of type MSGCLASS.
-
create
public static <Msg extends Serializable> SinkBox<Msg> create()
A new SinkBox with no type checking.
-
enqueue
protected void enqueue(Msg msg)
Description copied from class:QueuedMailbox
Place MSG at the end of the message queue.- Overrides:
enqueue
in classQueuedMailbox<Msg extends Serializable>
-
messageType
public Class<Msg> messageType()
Description copied from interface:Mailbox
The (runtime) type of message sent through this box.- Specified by:
messageType
in interfaceMailbox<Msg extends Serializable>
-
checkType
public <T extends Serializable> Mailbox<T> checkType(Class<T> msgClass)
Description copied from interface:Mailbox
Returns THIS, assuming that THIS conveys messages of class MSGCLASS.- Specified by:
checkType
in interfaceMailbox<Msg extends Serializable>
-
-