|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.cache.CachePolicy
A CachePolicy object determines for a given object whether it should be cached or not, and how. Code that makes use of a cache should use a CachePolicy object, when available, to determine if the object should be cached or not.
| Field Summary | |
static CachePolicy |
ALWAYS
Standard cache policy that advises to always cache a passed object. |
static CachePolicy |
NEVER
Standard cache policy that advises to never cache a passed object. |
| Constructor Summary | |
protected |
CachePolicy()
Instantiates a new cache policy without registering it |
protected |
CachePolicy(Object policyKey)
Instantiates a new cache policy, and registers it with the given policy key. |
| Method Summary | |
abstract boolean |
checkPolicy(Object o)
Checks whether the policy advises to cache the passed object. |
String |
getDescription()
Returns a description of the policy. |
static CachePolicy |
getPolicy(Object policyKey)
Obtains a cache policy given a policy key. |
static void |
putPolicy(Object policyKey,
CachePolicy policy)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static CachePolicy NEVER
public static CachePolicy ALWAYS
| Constructor Detail |
protected CachePolicy(Object policyKey)
protected CachePolicy()
| Method Detail |
public static CachePolicy getPolicy(Object policyKey)
policyKey - the key of the cache policy
IllegalArgumentException - if the policy does not exist
public static void putPolicy(Object policyKey,
CachePolicy policy)
public abstract boolean checkPolicy(Object o)
o - the object to check the cache for
true if the policy advises to cache this object, false otherwise.public String getDescription()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||