    All Packages  Class Hierarchy  This Package  Previous  Next  Index

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

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

public class CacheSweeper
extends Thread

##

CacheSweeper(CacheFilter)

##

checkInvalid(CachedResource, int)
  Should the given resource stay in the cache now.
garbageCollect()
  Run the garbage collector.
run()
signal()
updateGeneration(CachedResource, int, int)
  Move the given resource from one generation to another.
waitSignal()

##

CacheSweeper

     public CacheSweeper(CacheFilter filter)

##

signal

     public synchronized void signal()

waitSignal

     public synchronized 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 Thread

    All Packages  Class Hierarchy  This Package  Previous  Next  Index