stella.rmi
Class DailyDump.WriterCloseThread

java.lang.Object
  extended by java.lang.Thread
      extended by stella.rmi.DailyDump.WriterCloseThread
All Implemented Interfaces:
Runnable
Enclosing class:
DailyDump

private class DailyDump.WriterCloseThread
extends Thread

A shutdown hook that closes the argumental writer.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  Writer toclose
          The writer to close on run.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected DailyDump.WriterCloseThread(Writer arg)
          Constructs a new writer closing thread.
 
Method Summary
 void run()
          Tries to close the previously registered writer.
protected  void setWriter(Writer arg)
          Sets the writer that should be closed on run.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toclose

private Writer toclose
The writer to close on run.

Constructor Detail

DailyDump.WriterCloseThread

protected DailyDump.WriterCloseThread(Writer arg)
Constructs a new writer closing thread. The argument is the writer that should be closed at run. This writer can be changed anytime before running with the setWriter(java.io.Writer) method.

Method Detail

setWriter

protected void setWriter(Writer arg)
Sets the writer that should be closed on run. Cannot be used after the thread has been run.


run

public void run()
Tries to close the previously registered writer.

Specified by:
run in interface Runnable
Overrides:
run in class Thread