org.apache.manifoldcf.core.interfaces
Interface ICacheDescription

All Known Implementing Classes:
AuthorityConnectionManager.AuthorityConnectionDescription, BaseDescription, Jobs.JobObjectDescription, OutputConnectionManager.OutputConnectionDescription, QueryDescription, RepositoryConnectionManager.RepositoryConnectionDescription

public interface ICacheDescription

This interface represents objects that describe cacheable objects. Implementors of this interface should ideally be immutable, if they are used to describe objects that are placed in cache. Note well: The getCriticalSectionName() method described by this interface is meant to return the name of a critical section. This should be distinguishable from other critical sections in the system; it should therefore have the classname as a component.


Field Summary
static java.lang.String _rcsid
           
 
Method Summary
 java.lang.String getCriticalSectionName()
          Get the critical section name for this description object.
 ICacheClass getObjectClass()
          Get the object class for an object.
 long getObjectExpirationTime()
          Obtain an expiration time for an object, in milliseconds since epoch.
 StringSet getObjectKeys()
          Get the cache keys for an object (which may or may not exist yet in the cache).
 

Field Detail

_rcsid

static final java.lang.String _rcsid
See Also:
Constant Field Values
Method Detail

getObjectKeys

StringSet getObjectKeys()
Get the cache keys for an object (which may or may not exist yet in the cache). This method is called in order for cache manager to throw the correct locks.

Returns:
the object's cache keys, or null if the object should not be cached.

getCriticalSectionName

java.lang.String getCriticalSectionName()
Get the critical section name for this description object. This is used to synchronize creation of the described object, and thus is used only for objects that will be cached. This method does not need to return decent results for objects that are never cached.

Returns:
the critical section name.

getObjectClass

ICacheClass getObjectClass()
Get the object class for an object. The object class is used to determine the group of objects treated in the same LRU manner.

Returns:
the newly created object's object class, or null if there is no such class, and LRU behavior is not desired.

getObjectExpirationTime

long getObjectExpirationTime()
Obtain an expiration time for an object, in milliseconds since epoch. The cache manager will call this method for all objects that are being operated on, so that their expiration timestamps get properly updated to a new time.

Returns:
a time in milliseconds since epoch for the object to expire, or -1 if there is no expiration desired.