org.apache.log.output.io.rotate

Class OrRotateStrategy

public class OrRotateStrategy extends Object implements RotateStrategy

Hierarchical rotation strategy. This object is initialised with several rotation strategy objects. The isRotationNeeded method checks the first rotation strategy object. If a rotation is needed, this result is returned. If not, the next rotation strategy object is checked, and so on.

Author: Carsten Ziegeler

Field Summary
RotateStrategy[]m_strategies
intm_usedRotation
The rotation strategy used.
Constructor Summary
OrRotateStrategy(RotateStrategy[] strategies)
Constructor
Method Summary
booleanisRotationNeeded(String data, File file)
check if now a log rotation is neccessary.
voidreset()
reset.

Field Detail

m_strategies

private RotateStrategy[] m_strategies

m_usedRotation

private int m_usedRotation
The rotation strategy used. This marker is required for the reset() method.

Constructor Detail

OrRotateStrategy

public OrRotateStrategy(RotateStrategy[] strategies)
Constructor

Parameters: strategies the set of rotation strategies

Method Detail

isRotationNeeded

public boolean isRotationNeeded(String data, File file)
check if now a log rotation is neccessary. This object is initialised with several rotation strategy objects. The isRotationNeeded method checks the first rotation strategy object. If a rotation is needed, this result is returned. If not the next rotation strategy object is asked and so on.

Parameters: data the last message written to the log system file ???

Returns: boolean return true if log rotation is neccessary, else false

reset

public void reset()
reset.