public class GeneralCache extends Object
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
GeneralCache.ExpirationTree |
expirationTree |
protected GeneralCache.ObjectRecordTable |
hashtable |
protected GeneralCache.InvalidationTable |
invalidationTable |
protected GeneralCache.ObjectClassTable |
objectClassTable |
Constructor and Description |
---|
GeneralCache() |
Modifier and Type | Method and Description |
---|---|
protected void |
deleteEntry(GeneralCache.ObjectRecord record)
Delete a record from the cache.
|
void |
deleteObject(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(Object objectDescription)
Get the creation time of an object in the cache.
|
long |
getObjectExpirationTime(Object objectDescription)
Get the expiration time for an object in the cache.
|
StringSet |
getObjectInvalidationKeys(Object objectDescription)
Get the invalidation keys for an object in the cache.
|
void |
invalidateKeys(StringSet keys)
Invalidate a set of keys.
|
Object |
lookup(Object objectDescription)
Locate an object in the cache, and return it if found.
|
void |
setObject(Object objectDescription,
Object object,
StringSet keys,
long timestamp)
Add a newly created object to the cache.
|
void |
setObjectClass(Object objectDescription,
String objectClass,
int maxCount)
Set an object's class and maximum count.
|
void |
setObjectExpiration(Object objectDescription,
long expirationTime)
Set an object's expiration time.
|
public static final String _rcsid
protected GeneralCache.ObjectRecordTable hashtable
protected GeneralCache.InvalidationTable invalidationTable
protected GeneralCache.ObjectClassTable objectClassTable
public GeneralCache.ExpirationTree expirationTree
public Object lookup(Object objectDescription)
objectDescription
- is the object's unique identifier.public long getObjectCreationTime(Object objectDescription)
objectDescription
- is the object's unique identifier.public StringSet getObjectInvalidationKeys(Object objectDescription)
objectDescription
- is the object's unique identifier.public long getObjectExpirationTime(Object objectDescription)
objectDescription
- is the object's unique identifier.public void deleteObject(Object objectDescription)
objectDescription
- is the unique description.public void setObject(Object objectDescription, 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(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(Object objectDescription, 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.