org.cdlib.xtf.cache
Class CacheDependency

Object
  extended by Dependency
      extended by CacheDependency

public class CacheDependency
extends Dependency

CacheDependency represents a dependency on an entry of the same or another cache. If the cache entry changes, disappears, or its dependencies become stale, then this dependency also becomes stale.


Field Summary
 Cache cache
          The cache we're depending on
 Object key
          The key within that cache we're depending on
 long lastSet
          The set time of the cache entry when this dependency was created.
 
Constructor Summary
CacheDependency(Cache cache, Object key)
          Constructor.
 
Method Summary
 boolean validate()
          Checks if the dependency is still valid.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

public Cache cache
The cache we're depending on


key

public Object key
The key within that cache we're depending on


lastSet

public long lastSet
The set time of the cache entry when this dependency was created.

Constructor Detail

CacheDependency

public CacheDependency(Cache cache,
                       Object key)
Constructor.

Parameters:
cache - The cache containing the entry to depend on
key - Key value to depend on within that cache.
Method Detail

validate

public boolean validate()
Checks if the dependency is still valid. If the cache entry has changed, disappeared, or has invalid dependencies, then this dependency is stale.

Specified by:
validate in class Dependency
Returns:
true iff the dependency is still fresh.