| |
|
| java.lang.Object com.opensymphony.oscache.base.AbstractCacheAdministrator
All known Subclasses: com.opensymphony.oscache.general.GeneralCacheAdministrator, com.opensymphony.oscache.web.ServletCacheAdministrator,
AbstractCacheAdministrator | abstract public class AbstractCacheAdministrator implements java.io.Serializable(Code) | | An AbstractCacheAdministrator defines an abstract cache administrator, implementing all
the basic operations related to the configuration of a cache, including assigning
any configured event handlers to cache objects.
Extend this class to implement a custom cache administrator.
version: $Revision: 425 $ author: a href="mailto:mike@atlassian.com">Mike Cannon-Brookes author: Francois Beauregard author: Alain Bergevin author: Fabian Crabus author: Chris Miller |
CACHE_BLOCKING_KEY | final public static String CACHE_BLOCKING_KEY(Code) | | The configuration key that specifies whether we should block waiting for new
content to be generated, or just serve the old content instead. The default
behaviour is to serve the old content since that provides the best performance
(at the cost of serving slightly stale data).
|
CACHE_CAPACITY_KEY | final public static String CACHE_CAPACITY_KEY(Code) | | An integer cache configuration property that specifies the maximum number
of objects to hold in the cache. Setting this to a negative value will
disable the capacity functionality - there will be no limit to the number
of objects that are held in cache.
|
CACHE_DISK_UNLIMITED_KEY | final public static String CACHE_DISK_UNLIMITED_KEY(Code) | | A boolean cache configuration property that indicates whether the persistent
cache should be unlimited in size, or should be restricted to the same size
as the in-memory cache. Set this property to true to allow the
persistent cache to grow without bound.
|
CACHE_ENTRY_EVENT_LISTENERS_KEY | final public static String CACHE_ENTRY_EVENT_LISTENERS_KEY(Code) | | A String cache configuration property that holds a comma-delimited list of
classnames. These classes specify the event handlers that are to be applied
to the cache.
|
CACHE_MEMORY_KEY | final public static String CACHE_MEMORY_KEY(Code) | | A boolean cache configuration property that indicates whether the cache
should cache objects in memory. Set this property to false
to disable in-memory caching.
|
CACHE_PERSISTENCE_OVERFLOW_KEY | final public static String CACHE_PERSISTENCE_OVERFLOW_KEY(Code) | | A String cache configuration property that specifies if the cache persistence
will only be used in overflow mode, that is, when the memory cache capacity has been reached.
|
PERSISTENCE_CLASS_KEY | final public static String PERSISTENCE_CLASS_KEY(Code) | | A String cache configuration property that specifies the classname that will
be used to provide cache persistence. This class must extend
PersistenceListener .
|
AbstractCacheAdministrator | protected AbstractCacheAdministrator()(Code) | | Create the AbstractCacheAdministrator.
This will initialize all values and load the properties from oscache.properties.
|
AbstractCacheAdministrator | protected AbstractCacheAdministrator(Properties p)(Code) | | Create the AbstractCacheAdministrator.
Parameters: p - the configuration properties for this cache. |
configureStandardListeners | protected Cache configureStandardListeners(Cache cache)(Code) | | Applies all of the recognised listener classes to the supplied
cache object. Recognised classes are
CacheEntryEventListener and
CacheMapAccessEventListener .
Parameters: cache - The cache to apply the configuration to. cache The configured cache object. |
finalizeListeners | protected void finalizeListeners(Cache cache)(Code) | | Finalizes all the listeners that are associated with the given cache object.
Any FinalizationException s that are thrown by the listeners will
be caught and logged.
|
getCacheEventListeners | protected CacheEventListener[] getCacheEventListeners()(Code) | | Retrieves an array containing instances all of the
CacheEventListener classes that are specified in the OSCache configuration file.
|
getProperty | public String getProperty(String key)(Code) | | Retrieves the value of one of the configuration properties.
Parameters: key - The key assigned to the property Property value, or null if the property could not be found. |
isBlocking | public boolean isBlocking()(Code) | | Indicates whether the cache will block waiting for new content to
be built, or serve stale content instead of waiting. Regardless of this
setting, the cache will always block if new content is being
created, ie, there's no stale content in the cache that can be served.
|
isMemoryCaching | public boolean isMemoryCaching()(Code) | | Whether entries are cached in memory or not.
Default is true.
Set by the cache.memory property.
Status whether or not memory caching is used. |
isOverflowPersistence | public boolean isOverflowPersistence()(Code) | | Check if we use overflowPersistence
Returns the overflowPersistence. |
isUnlimitedDiskCache | public boolean isUnlimitedDiskCache()(Code) | | Indicates whether the unlimited disk cache is enabled or not.
|
setCacheCapacity | protected void setCacheCapacity(int newCacheCapacity)(Code) | | Sets the cache capacity (number of items). Administrator implementations
should override this method to ensure that their
Cache objects
are updated correctly (by calling
AbstractConcurrentReadCache.setMaxEntries(int) }}.
Parameters: newCacheCapacity - The new capacity |
setOverflowPersistence | public void setOverflowPersistence(boolean overflowPersistence)(Code) | | Sets the overflowPersistence flag
Parameters: overflowPersistence - The overflowPersistence to set. |
setPersistenceListener | protected Cache setPersistenceListener(Cache cache)(Code) | | If there is a PersistenceListener in the configuration
it will be instantiated and applied to the given cache object. If the
PersistenceListener cannot be found or instantiated, an
error will be logged but the cache will not have a persistence listener
applied to it and no exception will be thrown.
A cache can only have one PersistenceListener .
Parameters: cache - the cache to apply the PersistenceListener to. the same cache object that was passed in. |
|
|
|