Interface RotationStrategy
-
- All Known Implementing Classes:
TimeRotationStrategy
public interface RotationStrategyDefines aWriterrotation strategy that can be used in cooperation withRotationWriterto have one virtualWriterthat seamless rotates output to multiple output writers.- Author:
- bdferris
- See Also:
RotationWriter,TimeRotationStrategy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WritergetFirstWriter()WritergetNextWriter(Writer writer, int charactersWritten)Called to get the next output writer when a call is made toRotationWriter.flush().
-
-
-
Method Detail
-
getFirstWriter
Writer getFirstWriter() throws IOException
- Returns:
- the Writer that will be used for initial output
- Throws:
IOException
-
getNextWriter
Writer getNextWriter(Writer writer, int charactersWritten) throws IOException
Called to get the next output writer when a call is made toRotationWriter.flush(). The current writer is provided as a parameter, so if no rotation should occur, just return the current writer.- Parameters:
writer- the current output writercharactersWritten- the number of characters written to the current writer- Returns:
- the writer to output to in the future
- Throws:
IOException
-
-