net.sf.ashkay
Interface CachingStrategy

All Known Implementing Classes:
FullCachingStrategy, LastModifiedCachingStrategy, SoftReferenceCachingStrategy, TimeExpirationCachingStrategy

public interface CachingStrategy

CachingStrategies provide abstract strategies about how a cache ought to perform its caching. When an object is added to the cache, the CachingStrategy is asked to prepare the CacheEntry for that object. The CachingStrategy may return a new Entry that serves its purposes better, or may just set a few properties on the current entry.

When the object is looked up in the cache, the CachingStrategy is asked to validate this object, if the validation fails for any strategy, the object is reloaded.

Author:
Dave Brown

Method Summary
 CacheEntry prepare(CacheEntry entry)
          Prepares the cache entry for caching with this strategy.
NOTE: Be Careful: a caching strategy is allowed to return a different CacheEntry, so make sure that you store the results of this method and don't assume the symantics of pass by reference.
 boolean validate(CacheEntry entry)
          Validates this cache entry for this caching strategy.
 

Method Detail

prepare

public CacheEntry prepare(CacheEntry entry)
Prepares the cache entry for caching with this strategy.
NOTE: Be Careful: a caching strategy is allowed to return a different CacheEntry, so make sure that you store the results of this method and don't assume the symantics of pass by reference.


validate

public boolean validate(CacheEntry entry)
Validates this cache entry for this caching strategy.



Copyright © 2004 . All Rights Reserved.