org.onebusaway.container.rotation
Interface RotationStrategy

All Known Implementing Classes:
TimeRotationStrategy

public interface RotationStrategy

Defines a Writer rotation strategy that can be used in cooperation with RotationWriter to have one virtual Writer that seamless rotates output to multiple output writers.

Author:
bdferris
See Also:
RotationWriter, TimeRotationStrategy

Method Summary
 Writer getFirstWriter()
           
 Writer getNextWriter(Writer writer, int charactersWritten)
          Called to get the next output writer when a call is made to RotationWriter.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 to RotationWriter.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 writer
charactersWritten - the number of characters written to the current writer
Returns:
the writer to output to in the future
Throws:
IOException


Copyright © 2011 OneBusAway. All Rights Reserved.