org.w3c.www.protocol.http.cache
Class CacheSweeper

java.lang.Object
  extended by java.lang.Thread
      extended by org.w3c.www.protocol.http.cache.CacheSweeper
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
SimpleCacheSweeper

public abstract class CacheSweeper
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected static int STATE_CLEAN_GENERATIONS
           
protected static int STATE_CLEAN_STORED
           
protected static int STATE_FORCE_CLEAN_GENERATIONS
           
protected static int STATE_FORCE_CLEAN_STORED
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CacheSweeper()
           
 
Method Summary
protected abstract  long collectCached(CacheGeneration generation, long bytes, boolean check)
          collect the existing resources
protected abstract  long collectCached(long bytes, boolean check)
          collect the existing resources
protected abstract  void collectStored()
          collect the still stored resources (disk) in the whole cache
protected abstract  void collectStored(CacheGeneration generation)
          collect the still stored resources (disk)
abstract  void initialize(CacheFilter filter)
          initialize the sweeper
protected abstract  void setState(int state)
          change the state of the Sweeper
abstract  void signal()
          Used to trigger a signal
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_CLEAN_STORED

protected static final int STATE_CLEAN_STORED
See Also:
Constant Field Values

STATE_FORCE_CLEAN_STORED

protected static final int STATE_FORCE_CLEAN_STORED
See Also:
Constant Field Values

STATE_CLEAN_GENERATIONS

protected static final int STATE_CLEAN_GENERATIONS
See Also:
Constant Field Values

STATE_FORCE_CLEAN_GENERATIONS

protected static final int STATE_FORCE_CLEAN_GENERATIONS
See Also:
Constant Field Values
Constructor Detail

CacheSweeper

public CacheSweeper()
Method Detail

signal

public abstract void signal()
Used to trigger a signal


setState

protected abstract void setState(int state)
change the state of the Sweeper

Parameters:
an - integer, setting the new cache state

collectStored

protected abstract void collectStored(CacheGeneration generation)
collect the still stored resources (disk)

Parameters:
generation, - the CacheGeneration to clean

collectStored

protected abstract void collectStored()
collect the still stored resources (disk) in the whole cache


collectCached

protected abstract long collectCached(CacheGeneration generation,
                                      long bytes,
                                      boolean check)
collect the existing resources

Parameters:
generation, - the CacheGeneration to clean
bytes, - a long. The number of bytes to collect
check, - a boolean. If true, then only the stale resources will be removed
Returns:
a long, the number of collected bytes

collectCached

protected abstract long collectCached(long bytes,
                                      boolean check)
collect the existing resources

Parameters:
bytes, - a long. The number of bytes to collect
check, - a boolean. If true, then only the stale resources will be removed
Returns:
a long, the number of collected bytes

initialize

public abstract void initialize(CacheFilter filter)
initialize the sweeper