Package org.apache.log.output.io.rotate
Class OrRotateStrategy
- java.lang.Object
-
- org.apache.log.output.io.rotate.OrRotateStrategy
-
- All Implemented Interfaces:
RotateStrategy
public class OrRotateStrategy extends java.lang.Object implements RotateStrategy
Hierarchical rotation strategy. This object is initialised with several rotation strategy objects. TheisRotationNeeded
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.
-
-
Field Summary
Fields Modifier and Type Field Description private RotateStrategy[]
m_strategies
private int
m_usedRotation
The rotation strategy used.
-
Constructor Summary
Constructors Constructor Description OrRotateStrategy(RotateStrategy[] strategies)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRotationNeeded(java.lang.String data, java.io.File file)
check if now a log rotation is neccessary.void
reset()
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
-
reset
public void reset()
reset.- Specified by:
reset
in interfaceRotateStrategy
-
isRotationNeeded
public boolean isRotationNeeded(java.lang.String data, java.io.File file)
check if now a log rotation is neccessary. This object is initialised with several rotation strategy objects. TheisRotationNeeded
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.- Specified by:
isRotationNeeded
in interfaceRotateStrategy
- Parameters:
data
- the last message written to the log systemfile
- ???- Returns:
- boolean return true if log rotation is neccessary, else false
-
-