public abstract class CachePolicy extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
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.
|
| Modifier | Constructor and Description |
|---|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final CachePolicy NEVER
public static final CachePolicy ALWAYS
protected CachePolicy(Object policyKey)
protected CachePolicy()
public static CachePolicy getPolicy(Object policyKey)
policyKey - the key of the cache policyIllegalArgumentException - if the policy does not existpublic static void putPolicy(Object policyKey, CachePolicy policy)
public abstract boolean checkPolicy(Object o)
o - the object to check the cache fortrue if the policy advises to cache this object, false otherwise.public String getDescription()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}