|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.StreamImpl
com.caucho.log.RotateStream
public class RotateStream
Automatically-rotating streams. Normally, clients will call getStream instead of using the StreamImpl interface.
| Field Summary |
|---|
| Fields inherited from class com.caucho.vfs.StreamImpl |
|---|
_nullPath, _path |
| Method Summary | |
|---|---|
boolean |
canWrite()
True if the stream can write |
static void |
clear()
Clears the streams. |
void |
close()
The close call does nothing since the rotate stream is shared for many logs. |
static RotateStream |
create(Path path)
Returns the rotate stream corresponding to this path |
static RotateStream |
create(java.lang.String path)
Returns the rotate stream corresponding to this path |
void |
finalize()
|
void |
flush()
Flushes the underlying stream. |
Path |
getPath()
Returns the Path associated with the stream. |
AbstractRolloverLog |
getRolloverLog()
Returns the rollover log. |
WriteStream |
getStream()
Gets the current write stream |
void |
init()
Initialize the stream, setting any logStream, System.out and System.err as necessary. |
void |
setArchiveFormat(java.lang.String format)
Sets the archive format. |
void |
setMaxRolloverCount(int count)
Sets the maximum number of rolled logs. |
void |
setRolloverPeriod(long period)
Sets the log rollover period, rounded up to the nearest hour. |
void |
setRolloverSize(long size)
Sets the log rollover size in bytes. |
void |
write(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes to the stream |
| Methods inherited from class com.caucho.vfs.StreamImpl |
|---|
canRead, clearWrite, closeWrite, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, read, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static RotateStream create(Path path)
public static RotateStream create(java.lang.String path)
throws ConfigException
ConfigExceptionpublic static void clear()
public AbstractRolloverLog getRolloverLog()
public void setMaxRolloverCount(int count)
public void setRolloverPeriod(long period)
period - the new rollover period in milliseconds.public void setRolloverSize(long size)
public void setArchiveFormat(java.lang.String format)
format - the archive format.
public void init()
throws java.io.IOException
java.io.IOExceptionpublic Path getPath()
getPath in class StreamImplpublic boolean canWrite()
canWrite in class StreamImpl
public void write(byte[] buffer,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
write in class StreamImplbuffer - the byte array to write.offset - the offset into the byte array.length - the number of bytes to write.isEnd - true when the write is flushing a close.
java.io.IOExceptionpublic WriteStream getStream()
public void flush()
throws java.io.IOException
flush in class StreamImpljava.io.IOExceptionpublic void close()
close in class StreamImpl
public void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||