Logback API
Version 0.9.8

ch.qos.logback.core.rolling
Class RollingPolicyBase

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.rolling.RollingPolicyBase
All Implemented Interfaces:
RollingPolicy, ContextAware, LifeCycle
Direct Known Subclasses:
FixedWindowRollingPolicy, TimeBasedRollingPolicy

public abstract class RollingPolicyBase
extends ContextAwareBase
implements RollingPolicy

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ü

Field Summary
protected  int compressionMode
           
protected  FileNamePattern fileNamePattern
           
protected  String fileNamePatternStr
           
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
RollingPolicyBase()
           
 
Method Summary
protected  void determineCompressionMode()
          Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr.
 String getFileNamePattern()
           
 String getParentFileName()
           
 boolean isStarted()
           
 void setFileNamePattern(String fnp)
           
 void setParent(FileAppender appender)
          This method allows RollingPolicy implementations to be aware of their containing appender.
protected  void setParentFileName(String newFileName)
           
 void start()
           
 void stop()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.rolling.RollingPolicy
getNewActiveFileName, rollover
 

Field Detail

compressionMode

protected int compressionMode

fileNamePattern

protected FileNamePattern fileNamePattern

fileNamePatternStr

protected String fileNamePatternStr
Constructor Detail

RollingPolicyBase

public RollingPolicyBase()
Method Detail

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(String fnp)

getFileNamePattern

public String getFileNamePattern()

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle

start

public void start()
Specified by:
start in interface LifeCycle

stop

public void stop()
Specified by:
stop in interface LifeCycle

setParent

public void setParent(FileAppender appender)
Description copied from interface: RollingPolicy
This method allows RollingPolicy implementations to be aware of their containing appender.

Specified by:
setParent in interface RollingPolicy

getParentFileName

public String getParentFileName()

setParentFileName

protected void setParentFileName(String newFileName)

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.