uk.org.simonsite.log4j.appender
Class LogFileCompressorTask

java.lang.Object
  extended by uk.org.simonsite.log4j.appender.LogFileCompressorTask
All Implemented Interfaces:
Runnable, EventListener, FileRollEventListener

final class LogFileCompressorTask
extends Object
implements Runnable, FileRollEventListener

Responsible for compressing log files using a given compression algorithm, adding checksums if specified.

Version:
1.1
Author:
Simon Park

Constructor Summary
LogFileCompressorTask(TimeAndSizeRollingAppender rollingAppender)
           
 
Method Summary
(package private)  void addFileCompressionEventListener(FileCompressionEventListener fileCompressionEventListener)
           
(package private)  void compress(File file)
           
(package private)  void fireFileCompressionEvent(FileCompressionEvent fileCompressionEvent)
           
(package private)  int getQueueLimit()
          For test purposes only.
(package private)  int getTestQueueSize()
          For test purposes only.
 void onFileRoll(FileRollEvent fileRollEvent)
           
(package private)  void removeFileCompressionEventListener(FileCompressionEventListener fileCompressionEventListener)
           
 void run()
           
(package private)  void waitForEmptyQueue()
          For test purposes only.
(package private)  void waitForSizeQueue(int queueSize)
          For test purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFileCompressorTask

LogFileCompressorTask(TimeAndSizeRollingAppender rollingAppender)
Method Detail

run

public final void run()
Specified by:
run in interface Runnable

onFileRoll

public final void onFileRoll(FileRollEvent fileRollEvent)
Specified by:
onFileRoll in interface FileRollEventListener

getQueueLimit

final int getQueueLimit()
For test purposes only.

Returns:
max files in the backup file queue

getTestQueueSize

final int getTestQueueSize()
For test purposes only.

Returns:
number of files remaining in the backup file queue

waitForEmptyQueue

final void waitForEmptyQueue()
For test purposes only.


waitForSizeQueue

final void waitForSizeQueue(int queueSize)
For test purposes only.


compress

final void compress(File file)

addFileCompressionEventListener

final void addFileCompressionEventListener(FileCompressionEventListener fileCompressionEventListener)

removeFileCompressionEventListener

final void removeFileCompressionEventListener(FileCompressionEventListener fileCompressionEventListener)

fireFileCompressionEvent

final void fireFileCompressionEvent(FileCompressionEvent fileCompressionEvent)