|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.manifoldcf.core.cachemanager.GeneralCache
public class GeneralCache
General cache class. This class will be statically instantiated. It contains all the structures needed to maintain a cache of objects, with both LRU flushing behavior, and timed expiration of objects. This cache is entirely local to a JVM and does NOT have any locking and synchronization semantics cross-JVM. That is handled at a higher level.
| Nested Class Summary | |
|---|---|
protected class |
GeneralCache.ExpirationTree
This class represents a timed expiration tree. |
protected class |
GeneralCache.ExpirationTreeNode
This class represents a node in the expiration tree. |
protected class |
GeneralCache.InvalidationTable
This class describes a table of invalidation keys, each of which points to a set of object records. |
protected class |
GeneralCache.ObjectClassRecord
This is a helper class for the ObjectClassTable. |
protected class |
GeneralCache.ObjectClassTable
This class describes a set of object classes, each with its own LRU behavior. |
protected class |
GeneralCache.ObjectRecord
This class represents a cached object. |
protected class |
GeneralCache.ObjectRecordTable
This class describes a table of object records, looked up by the unique object description. |
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
GeneralCache.ExpirationTree |
expirationTree
|
protected GeneralCache.ObjectRecordTable |
hashtable
|
protected GeneralCache.InvalidationTable |
invalidationTable
|
protected GeneralCache.ObjectClassTable |
objectClassTable
|
| Constructor Summary | |
|---|---|
GeneralCache()
|
|
| Method Summary | |
|---|---|
protected void |
deleteEntry(GeneralCache.ObjectRecord record)
Delete a record from the cache. |
void |
deleteObject(java.lang.Object objectDescription)
Delete a record from the cache. |
void |
expireRecords(long expireTime)
Expire all records that have older expiration times than that passed in. |
long |
getObjectCreationTime(java.lang.Object objectDescription)
Get the creation time of an object in the cache. |
StringSet |
getObjectInvalidationKeys(java.lang.Object objectDescription)
Get the invalidation keys for an object in the cache. |
void |
invalidateKeys(StringSet keys)
Invalidate a set of keys. |
java.lang.Object |
lookup(java.lang.Object objectDescription)
Locate an object in the cache, and return it if found. |
void |
setObject(java.lang.Object objectDescription,
java.lang.Object object,
StringSet keys,
long timestamp)
Add a newly created object to the cache. |
void |
setObjectClass(java.lang.Object objectDescription,
java.lang.String objectClass,
int maxCount)
Set an object's class and maximum count. |
void |
setObjectExpiration(java.lang.Object objectDescription,
long expirationTime)
Set an object's expiration time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
protected GeneralCache.ObjectRecordTable hashtable
protected GeneralCache.InvalidationTable invalidationTable
protected GeneralCache.ObjectClassTable objectClassTable
public GeneralCache.ExpirationTree expirationTree
| Constructor Detail |
|---|
public GeneralCache()
| Method Detail |
|---|
public java.lang.Object lookup(java.lang.Object objectDescription)
objectDescription - is the object's unique identifier.
public long getObjectCreationTime(java.lang.Object objectDescription)
objectDescription - is the object's unique identifier.
public StringSet getObjectInvalidationKeys(java.lang.Object objectDescription)
objectDescription - is the object's unique identifier.
public void deleteObject(java.lang.Object objectDescription)
objectDescription - is the unique description.
public void setObject(java.lang.Object objectDescription,
java.lang.Object object,
StringSet keys,
long timestamp)
objectDescription - is the newly created object's unique description.object - is the newly created object itself.keys - are the invalidation keys for the newly created object.timestamp - is the creation timestamp for this object (used for cross-JVM invalidation)
public void setObjectExpiration(java.lang.Object objectDescription,
long expirationTime)
objectDescription - is the object's unique description.expirationTime - is the object's new expiration time, in milliseconds since epoch.
public void setObjectClass(java.lang.Object objectDescription,
java.lang.String objectClass,
int maxCount)
objectDescription - is the object's unique description.objectClass - is the object's "class", or grouping for the purposes of LRU.maxCount - is the maximum number of objects of the class to permit to
remain in the cache.public void invalidateKeys(StringSet keys)
keys - is the StringSet describing the keys to invalidate.public void expireRecords(long expireTime)
expireTime - is the time to compare against, in milliseconds since epoch.protected void deleteEntry(GeneralCache.ObjectRecord record)
record - is the object record.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||