net.sf.farrago.util
Interface FarragoObjectCache.CachedObjectFactory

All Known Implementing Classes:
FarragoDataWrapperCache.ServerFactory, FarragoDataWrapperCache.WrapperFactory, FarragoObjectCacheTest.RentalCarAgency, ReposDefaultValueFactory
Enclosing class:
FarragoObjectCache

public static interface FarragoObjectCache.CachedObjectFactory

Factory interface for producing cached objects. This must be implemented by callers to FarragoObjectCache.


Method Summary
 void initializeEntry(Object key, FarragoObjectCache.UninitializedEntry entry)
          Initializes a cache entry.
 boolean isStale(Object value)
          Tests a cached object for staleness.
 

Method Detail

initializeEntry

void initializeEntry(Object key,
                     FarragoObjectCache.UninitializedEntry entry)
Initializes a cache entry.

Parameters:
key - key of the object to be constructed
entry - to initialize by calling its FarragoObjectCache.UninitializedEntry.initialize(java.lang.Object, long, boolean) method; failing to call initialize will lead to a subsequent assertion (unless an exception is thrown to indicate initialization failure)

isStale

boolean isStale(Object value)
Tests a cached object for staleness.

Returns:
true if object is stale, meaning it must not be returned from a pin call, and should be discarded from the cache when detected