|
||||||||||
| 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()
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 |
handleAlarm(Alarm alarm)
Handles a callback from an alarm. |
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 |
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, 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 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 StreamImplpublic void handleAlarm(Alarm alarm)
AlarmListener
handleAlarm in interface AlarmListenerpublic void finalize()
finalize in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||