| java.lang.Object org.mmbase.cache.CachePolicy
CachePolicy | abstract public class CachePolicy implements Serializable(Code) | | 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.
since: MMBase 1.8 author: Pierre van Rooden version: $Id: CachePolicy.java,v 1.4 2007/02/11 19:21:11 nklasens Exp $ |
Field Summary | |
public static CachePolicy | ALWAYS Standard cache policy that advises to always cache a passed object. | public static CachePolicy | NEVER Standard cache policy that advises to never cache a passed object. |
Constructor Summary | |
protected | CachePolicy(Object policyKey) Instantiates a new cache policy, and registers it with the given policy key. | protected | CachePolicy() |
ALWAYS | public static CachePolicy ALWAYS(Code) | | Standard cache policy that advises to always cache a passed object.
Accessible with the key "always".
|
NEVER | public static CachePolicy NEVER(Code) | | Standard cache policy that advises to never cache a passed object.
Accessible with the key "never".
|
CachePolicy | protected CachePolicy(Object policyKey)(Code) | | Instantiates a new cache policy, and registers it with the given policy key.
|
CachePolicy | protected CachePolicy()(Code) | | Instantiates a new cache policy without registering it
|
checkPolicy | abstract public boolean checkPolicy(Object o)(Code) | | Checks whether the policy advises to cache the passed object.
Parameters: o - the object to check the cache for true if the policy advises to cache this object, false otherwise. |
getDescription | public String getDescription()(Code) | | Returns a description of the policy.
|
getPolicy | public static CachePolicy getPolicy(Object policyKey)(Code) | | Obtains a cache policy given a policy key.
Parameters: policyKey - the key of the cache policy the policy key throws: IllegalArgumentException - if the policy does not exist |
|
|