Log4j 1.3alpha-1

org.apache.log4j.rolling
Class SlidingWindowRollingPolicy

java.lang.Object
  |
  +--org.apache.log4j.rolling.RollingPolicySkeleton
        |
        +--org.apache.log4j.rolling.SlidingWindowRollingPolicy
All Implemented Interfaces:
OptionHandler, RollingPolicy

public class SlidingWindowRollingPolicy
extends RollingPolicySkeleton

The SlidingWindowRollingPolicy rolls over files

Since:
1.3
Author:
Ceki Gülcü

Field Summary
 
Fields inherited from class org.apache.log4j.rolling.RollingPolicySkeleton
activeFileName, compressionMode, fileNamePattern, fileNamePatternStr
 
Constructor Summary
SlidingWindowRollingPolicy()
           
 
Method Summary
 void activateOptions()
          Activate the options that were previously set with calls to option setters.
 java.lang.String getActiveFileName()
          If the ActiveFileName option is set, then this method simply returns the value of the option.
 int getMaxIndex()
           
 int getMinIndex()
           
 void rollover()
          Rolls over log files according to implementation policy.
 void setMaxIndex(int maxIndex)
           
 void setMinIndex(int minIndex)
           
 
Methods inherited from class org.apache.log4j.rolling.RollingPolicySkeleton
determineCompressionMode, getFileNamePattern, getLogger, setActiveFileName, setFileNamePattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlidingWindowRollingPolicy

public SlidingWindowRollingPolicy()
Method Detail

activateOptions

public void activateOptions()
Description copied from interface: OptionHandler
Activate the options that were previously set with calls to option setters.

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

Specified by:
activateOptions in interface OptionHandler
Specified by:
activateOptions in class RollingPolicySkeleton

rollover

public void rollover()
              throws RolloverFailure
Description copied from interface: RollingPolicy
Rolls over log files according to implementation policy.

This method is invoked by RollingFileAppender, usually at the behest of its TriggeringPolicy.

Throws:
RolloverFailure - Thrown if the rollover operation fails for any reason.

getActiveFileName

public java.lang.String getActiveFileName()
If the ActiveFileName option is set, then this method simply returns the value of the option. Otherwise, it returns the value of FileNamePattern for MaxIndex. For example, if ActiveFileName is not set and FileNamePattern is set to "mylogfile.%i" and MaxIndex is set to 0, then this method will return "mylogfile.0".


getMaxIndex

public int getMaxIndex()

getMinIndex

public int getMinIndex()

setMaxIndex

public void setMaxIndex(int maxIndex)

setMinIndex

public void setMinIndex(int minIndex)

Log4j 1.3alpha-1

Copyright 2000-2003 Apache Software Foundation.