Top Description Fields Constructors Methods
org.apache.log.output.io.rotate

public Class OrRotateStrategy

extends Object
implements RotateStrategy
Class Inheritance
All Implemented Interfaces
org.apache.log.output.io.rotate.RotateStrategy
Imports
java.io.File

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

Modifier and TypeField and Description
private RotateStrategy[]
private int
m_usedRotation

The rotation strategy used.

Constructor Summary

AccessConstructor and Description
public
OrRotateStrategy(final RotateStrategy[]
the set of rotation strategies
strategies
)

Constructor

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

boolean return true if log rotation is neccessary, else false
isRotationNeeded
(final String
the last message written to the log system
data
,
final File
???
file
)

Implements org.apache.log.output.io.rotate.RotateStrategy.isRotationNeeded.

check if now a log rotation is neccessary.
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_strategiesback to summary
private RotateStrategy[] m_strategies
m_usedRotationback to summary
private int m_usedRotation

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

Constructor Detail

OrRotateStrategyback to summary
public OrRotateStrategy(final RotateStrategy[] strategies)

Constructor

Parameters
strategies:RotateStrategy[]

the set of rotation strategies

Method Detail

isRotationNeededback to summary
public boolean isRotationNeeded(final String data, final File file)

Implements org.apache.log.output.io.rotate.RotateStrategy.isRotationNeeded.

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:String

the last message written to the log system

file:File

???

Returns:boolean

boolean return true if log rotation is neccessary, else false

resetback to summary
public void reset()

Implements org.apache.log.output.io.rotate.RotateStrategy.reset.

reset.