|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.resource.GenerationalCacheManager
An implementation of CacheManager which uses the "VFC" cache manager from Acctiva and Open Doors Software.
This manager provides a number of specific property options to support flexible deployment. Understanding these options is useful if you want behavior to adapt from development to deployment.
The default behavior, for the most part, is optimized for production deployment. Therefore, you must explicitly set some options to gain certain kinds of caching behavior appropriate for a development setting, eg, reloadability of a file which has changed on disk.
This cache manager supports reloadability of a cache entry provided the cache element knows how to test itself for having become stale.
The GenerationalCacheManager implements the CacheManager interface for WebMacro providers which extend the CachingProvider base class. This implementation encapsulates the use of VFC provided by Open Doors Software and incorporated into WM.
Constructor Summary | |
GenerationalCacheManager()
|
Method Summary | |
void |
destroy()
Same as defined in Provider |
void |
flush()
Same as defined in Provider |
java.lang.Object |
get(java.lang.Object query)
Get the object associated with the specific query, trying to look it up in a cache. |
java.lang.Object |
get(java.lang.Object query,
ResourceLoader helper)
Get the cached value and load it if it is not present or reloading is required. |
long[] |
getMetrics()
Returns cache instrumentation statistics. |
java.lang.String |
getResourceType()
Returns the wm type of resource it is caching. |
void |
init(Broker b,
Settings config,
java.lang.String resourceType)
Same as defined in Provider, except with an additional type parameter so it knows what type of resource it is caching |
void |
invalidate(java.lang.Object query)
Invalidate an entry in the cache. |
void |
put(java.lang.Object query,
java.lang.Object resource)
Put an object in the cache |
boolean |
supportsReload()
This manager supports reloading and so this returns true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GenerationalCacheManager()
Method Detail |
public void init(Broker b, Settings config, java.lang.String resourceType) throws InitException
CacheManager
init
in interface CacheManager
InitException
public void flush()
CacheManager
flush
in interface CacheManager
public void destroy()
CacheManager
destroy
in interface CacheManager
public java.lang.Object get(java.lang.Object query, ResourceLoader helper) throws ResourceException
get
in interface CacheManager
ResourceException
public java.lang.Object get(java.lang.Object query)
get
in interface CacheManager
public void put(java.lang.Object query, java.lang.Object resource)
put
in interface CacheManager
public void invalidate(java.lang.Object query)
invalidate
in interface CacheManager
public boolean supportsReload()
supportsReload
in interface CacheManager
public java.lang.String getResourceType()
public long[] getMetrics()
These statistics will be zero if the cache implementation is not using the instrumented get() routine.
Use of this routine is normally reserved for performance analysis and depends on recompiling org.opendoors.cache.immutable.CacheImpl
[0] The total number of gets, accesses. [1] The number of accesses which resulted in a hit to the immutable cache. [2] The number of accesses which resulted in a hit to the mutable cache. [3] The number of accesses which resulted in a fault and a need to regenerate the cache entry.
org.opendoors.cache.impl.CacheImpl
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |