A governing class for Roller cache objects.
The purpose of the CacheManager is to provide a level of abstraction between
classes that use a cache and the implementations of a cache. This allows
us to create easily pluggable cache implementations.
The other purpose is to provide a single interface for interacting with all
Roller caches at the same time. This is beneficial because as data
changes in the system we often need to notify all caches that some part of
their cached data needs to be invalidated, and the CacheManager makes that
process easier.
constructCache(CacheHandler handler, Map properties) Ask the CacheManager to construct a cache.
Normally the CacheManager will use whatever CacheFactory has been
chosen for the system via the cache.defaultFactory property.
However, it is possible to override the use of the default factory by
supplying a "factory" property to this method.
Ask the CacheManager to construct a cache.
Normally the CacheManager will use whatever CacheFactory has been
chosen for the system via the cache.defaultFactory property.
However, it is possible to override the use of the default factory by
supplying a "factory" property to this method. The value should
be the full classname for the factory you want to use for constructing
the cache.
example:
factory -> org.apache.roller.util.cache.LRUCacheFactoryImpl
This allows Roller admins the ability to choose a caching strategy to
use for the whole system, but override it in certain places where they
see fit. It also allows users to write their own caching modifications
and have them used only by specific caches.
Compile stats from all registered caches.
This is basically a hacky version of instrumentation which is being
thrown in because we don't have a full instrumentation strategy yet.
This is here with the full expectation that it will be replaced by
something a bit more elaborate, like JMX.
Register a CacheHandler to listen for object invalidations.
This is here so that it's possible to to add classes which would respond
to object invalidations without necessarily having to create a cache.
An example would be a handler designed to notify other machines in a
cluster when an object has been invalidated, or possibly the search
index management classes are interested in knowing when objects are
invalidated.