com.caucho.vfs
Class LogStream

java.lang.Object
  |
  +--com.caucho.vfs.StreamImpl
        |
        +--com.caucho.vfs.LogStream
All Implemented Interfaces:
ChangeListener, java.util.EventListener

public class LogStream
extends StreamImpl
implements ChangeListener

The primary debugging stream in Resin.


Fields inherited from class com.caucho.vfs.StreamImpl
path
 
Method Summary
 boolean canWrite()
           
 void close()
           
 void flush()
           
 void handleChange(java.lang.Object object)
          When the resin.conf changes, update the logging.
static WriteStream open(java.lang.String logId)
          Create a new stream based on the logId.
 void write(byte[] buf, int offset, int length)
          Writes the buffered chunk to the underlying stream.
 
Methods inherited from class com.caucho.vfs.StreamImpl
canRead, clearWrite, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getPath, getReadPosition, read, removeAttribute, setAttribute, setPath, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handleChange

public void handleChange(java.lang.Object object)
When the resin.conf changes, update the logging.
Specified by:
handleChange in interface ChangeListener

open

public static WriteStream open(java.lang.String logId)
Create a new stream based on the logId. The LogStream will only write to something if it's configured in the resin.conf.
Parameters:
logId - the name of the debug stream to open

canWrite

public final boolean canWrite()
Overrides:
canWrite in class StreamImpl

write

public void write(byte[] buf,
                  int offset,
                  int length)
           throws java.io.IOException
Writes the buffered chunk to the underlying stream.
Overrides:
write in class StreamImpl
Parameters:
buf - byte buffer to write
offset - offset into the buffer to start writing
length - length of the buffer to write

flush

public void flush()
Overrides:
flush in class StreamImpl

close

public void close()
Overrides:
close in class StreamImpl