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

java.lang.Object
  extended by java.lang.Thread
      extended by ucb.util.mailbox.MailboxWatch<Msg>
All Implemented Interfaces:
Runnable

public class MailboxWatch<Msg extends Serializable>
extends Thread

A MailboxWatch takes a stream of forwarded messages from a Mailbox and prints them to a specified stream. It is a thread and can be stopped by being interrupted.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MailboxWatch(Class<Msg> msgClass, Mailbox<Msg> box, String id, PrintStream str)
          A new MailboxWatch on BOX, reporting to STR.
 
Method Summary
 void close()
           
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailboxWatch

public MailboxWatch(Class<Msg> msgClass,
                    Mailbox<Msg> box,
                    String id,
                    PrintStream str)
A new MailboxWatch on BOX, reporting to STR. ID is a string used to label each reported message.

Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

close

public void close()