org.apache.log4j.rolling
Class RollingPolicyBase

java.lang.Object
  extended by org.apache.log4j.rolling.RollingPolicyBase
All Implemented Interfaces:
RollingPolicy, org.apache.log4j.spi.OptionHandler
Direct Known Subclasses:
FixedWindowRollingPolicy, TimeBasedRollingPolicy

public abstract class RollingPolicyBase
extends java.lang.Object
implements RollingPolicy, org.apache.log4j.spi.OptionHandler

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

Author:
Ceki Gülcü, Curt Arnold

Field Summary
protected  java.lang.String activeFileName
          Active file name may be null.
 
Constructor Summary
RollingPolicyBase()
           
 
Method Summary
 void activateOptions()
          
protected  void formatFileName(java.lang.Object obj, java.lang.StringBuffer buf)
          Format file name.
 java.lang.String getActiveFileName()
          Deprecated. Duplicates FileAppender.file and should be removed
protected  PatternConverter getDatePatternConverter()
           
 java.lang.String getFileNamePattern()
          Get file name pattern.
protected  PatternConverter getIntegerPatternConverter()
           
protected  void parseFileNamePattern()
          Parse file name pattern.
 void setActiveFileName(java.lang.String afn)
          Deprecated. Duplicates FileAppender.file and should be removed
 void setFileNamePattern(java.lang.String fnp)
          Set file name pattern.
 
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
initialize, rollover
 

Field Detail

activeFileName

protected java.lang.String activeFileName
Active file name may be null. Duplicates FileAppender.file and should be removed.

Constructor Detail

RollingPolicyBase

public RollingPolicyBase()
Method Detail

activateOptions

public void activateOptions()

Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler

setFileNamePattern

public void setFileNamePattern(java.lang.String fnp)
Set file name pattern.

Parameters:
fnp - file name pattern.

getFileNamePattern

public java.lang.String getFileNamePattern()
Get file name pattern.

Returns:
file name pattern.

setActiveFileName

public void setActiveFileName(java.lang.String afn)
Deprecated. Duplicates FileAppender.file and should be removed

ActiveFileName can be left unset, i.e. as null.

Parameters:
afn - active file name.

getActiveFileName

public java.lang.String getActiveFileName()
Deprecated. Duplicates FileAppender.file and should be removed

Return the value of the ActiveFile option.

Returns:
active file name.

parseFileNamePattern

protected final void parseFileNamePattern()
Parse file name pattern.


formatFileName

protected final void formatFileName(java.lang.Object obj,
                                    java.lang.StringBuffer buf)
Format file name.

Parameters:
obj - object to be evaluted in formatting, may not be null.
buf - string buffer to which formatted file name is appended, may not be null.

getDatePatternConverter

protected final PatternConverter getDatePatternConverter()

getIntegerPatternConverter

protected final PatternConverter getIntegerPatternConverter()


Copyright © 2010 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras Companion for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.