org.apache.jcs.auxiliary.disk.jdbc
Class ShrinkerThread

java.lang.Object
  extended by org.apache.jcs.auxiliary.disk.jdbc.ShrinkerThread
All Implemented Interfaces:
java.lang.Runnable

public class ShrinkerThread
extends java.lang.Object
implements java.lang.Runnable

Calls delete expired on the disk caches. The shrinker is run by a clock daemon. The shrinker calls delete on each region. It pauses between calls.

Author:
Aaron Smuts

Constructor Summary
protected ShrinkerThread()
          Does nothing special.
 
Method Summary
 void addDiskCacheToShrinkList(JDBCDiskCache diskCache)
          Adds a JDBC disk cache to the set of disk cache to shrink.
 long getPauseBetweenRegionCallsMillis()
          How long should we wait between calls to deleteExpired when we are iterating through the list of regions.
 void run()
          Calls deleteExpired on each item in the set.
 void setPauseBetweenRegionCallsMillis(long pauseBetweenRegionCallsMillis)
          How long should we wait between calls to deleteExpired when we are iterating through the list of regions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShrinkerThread

protected ShrinkerThread()
Does nothing special.

Method Detail

addDiskCacheToShrinkList

public void addDiskCacheToShrinkList(JDBCDiskCache diskCache)
Adds a JDBC disk cache to the set of disk cache to shrink.

Parameters:
diskCache -

run

public void run()
Calls deleteExpired on each item in the set. It pauses between each call.

Specified by:
run in interface java.lang.Runnable

setPauseBetweenRegionCallsMillis

public void setPauseBetweenRegionCallsMillis(long pauseBetweenRegionCallsMillis)
How long should we wait between calls to deleteExpired when we are iterating through the list of regions.

Parameters:
pauseBetweenRegionCallsMillis - The pauseBetweenRegionCallsMillis to set.

getPauseBetweenRegionCallsMillis

public long getPauseBetweenRegionCallsMillis()
How long should we wait between calls to deleteExpired when we are iterating through the list of regions.

Returns:
Returns the pauseBetweenRegionCallsMillis.


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.