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

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.w3c.www.protocol.http.cache.CacheSweeper

public class CacheSweeper
extends java.lang.Thread


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CacheSweeper(CacheFilter filter)
           
 
Method Summary
 boolean checkInvalid(CachedResource r, int mingen)
          Should the given resource stay in the cache now.
 void garbageCollect()
          Run the garbage collector.
 void run()
           
 void signal()
           
protected  void updateGeneration(CachedResource resource, int from, int to)
          Move the given resource from one generation to another.
 void waitSignal()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Constructor Detail

CacheSweeper

public CacheSweeper(CacheFilter filter)
Method Detail

signal

public void signal()

waitSignal

public void waitSignal()

checkInvalid

public boolean checkInvalid(CachedResource r,
                            int mingen)
Should the given resource stay in the cache now. This method just checks against generation numbers to decide wether the resource should stay or not. It's likely that this method will improve over time (to handle disconnected caching, etc).
Parameters:
r - The resource to check.
mingen - The recommended generation for that resource to stay in.
Returns:
A boolean, true if the resource should stay, false if it should leave.

updateGeneration

protected void updateGeneration(CachedResource resource,
                                int from,
                                int to)
Move the given resource from one generation to another.
Parameters:
resource - The cached resource whose generation is about to change.
from - The from generation.
to - The to generation.

garbageCollect

public void garbageCollect()
Run the garbage collector.

run

public void run()
Overrides:
run in class java.lang.Thread