Class OrRotateStrategy
java.lang.Object
org.apache.log.output.io.rotate.OrRotateStrategy
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprivate RotateStrategy[]private intThe rotation strategy used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisRotationNeeded(String data, File file) check if now a log rotation is neccessary.voidreset()reset.
-
Field Details
-
m_strategies
-
m_usedRotation
private int m_usedRotationThe rotation strategy used. This marker is required for the reset() method.
-
-
Constructor Details
-
OrRotateStrategy
Constructor- Parameters:
strategies- the set of rotation strategies
-
-
Method Details
-
reset
-
isRotationNeeded
check if now a log rotation is neccessary. This object is initialised with several rotation strategy objects. TheisRotationNeededmethod 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:
isRotationNeededin interfaceRotateStrategy- Parameters:
data- the last message written to the log systemfile- ???- Returns:
- boolean return true if log rotation is neccessary, else false
-