gnu.text
Class WriterManager
- Runnable
public class WriterManager
extends java.lang.Object
implements Runnable
Manages a collection of Writers, handling automatic closing.
This class is useful for making sure that a Writer is closed (and its
buffers flushed) when a VM exits.
A WriterManager can be usefully passed to the JDK 1.3 method
addShutdownHook in Runtime.
register
public gnu.text.WriterRef register(Writer port)
Register a Writer.
registerShutdownHook
public boolean registerShutdownHook()
Try to register this as a shutdown hook.
- true on success; false if failure (e.g. if not JDK1.3-compatible).
unregister
public void unregister(Object key)
Unregister a Writer.