Log4j 1.3alpha-3

org.apache.log4j.rolling
Class RollingPolicySkeleton

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

public abstract class RollingPolicySkeleton
extends java.lang.Object
implements RollingPolicy

Implements methods common to most, it not all, rolling policies. Currently such methods are limited to a compression mode getter/setter.

Since:
1.3
Author:
Ceki Gülcü

Field Summary
protected  java.lang.String activeFileName
           
protected  int compressionMode
           
protected  FileNamePattern fileNamePattern
           
protected  java.lang.String fileNamePatternStr
           
 
Constructor Summary
RollingPolicySkeleton()
           
 
Method Summary
abstract  void activateOptions()
          Activate the options that were previously set with calls to option setters.
protected  void determineCompressionMode()
          Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr.
 java.lang.String getFileNamePattern()
           
protected  Logger getLogger()
          Return an instance specific logger to be used by the policy itself.
 void setActiveFileName(java.lang.String afn)
          ActiveFileName can be left unset, i.e. as null.
 void setFileNamePattern(java.lang.String fnp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.log4j.rolling.RollingPolicy
getActiveFileName, rollover
 

Field Detail

compressionMode

protected int compressionMode

fileNamePattern

protected FileNamePattern fileNamePattern

fileNamePatternStr

protected java.lang.String fileNamePatternStr

activeFileName

protected java.lang.String activeFileName
Constructor Detail

RollingPolicySkeleton

public RollingPolicySkeleton()
Method Detail

activateOptions

public abstract 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

determineCompressionMode

protected void determineCompressionMode()
Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr. Patterns ending with .gz imply GZIP compression, endings with '.zip' imply ZIP compression. Otherwise and by default, there is no compression.


setFileNamePattern

public void setFileNamePattern(java.lang.String fnp)

getFileNamePattern

public java.lang.String getFileNamePattern()

setActiveFileName

public void setActiveFileName(java.lang.String afn)
ActiveFileName can be left unset, i.e. as null.

See Also:
RollingPolicy.getActiveFileName()

getLogger

protected Logger getLogger()
Return an instance specific logger to be used by the policy itself.

Returns:
instance specific logger

Log4j 1.3alpha-3

Copyright 2000-2003 Apache Software Foundation.