ucb.util.mailbox
Class SinkBox<Msg extends Serializable>

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by ucb.util.mailbox.QueuedMailbox<Msg>
                  extended by 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
 
Constructor Summary
protected SinkBox(Class<Msg> msgClass)
           
 
Method Summary
<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, 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
 

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 class QueuedMailbox<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 interface Mailbox<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 interface Mailbox<Msg extends Serializable>