org.webmacro.resource
Class GenerationalCacheManager

java.lang.Object
  |
  +--org.webmacro.resource.GenerationalCacheManager
All Implemented Interfaces:
CacheManager

public class GenerationalCacheManager
extends java.lang.Object
implements CacheManager

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

GenerationalCacheManager

public GenerationalCacheManager()
Method Detail

init

public void init(Broker b,
                 Settings config,
                 java.lang.String resourceType)
          throws InitException
Description copied from interface: CacheManager
Same as defined in Provider, except with an additional type parameter so it knows what type of resource it is caching
Specified by:
init in interface CacheManager

flush

public void flush()
Description copied from interface: CacheManager
Same as defined in Provider
Specified by:
flush in interface CacheManager

destroy

public void destroy()
Description copied from interface: CacheManager
Same as defined in Provider
Specified by:
destroy in interface CacheManager

get

public java.lang.Object get(java.lang.Object query,
                            ResourceLoader helper)
                     throws ResourceException
Get the cached value and load it if it is not present or reloading is required.
Specified by:
get in interface CacheManager

get

public java.lang.Object get(java.lang.Object query)
Get the object associated with the specific query, trying to look it up in a cache. If it's not there, return null.
Specified by:
get in interface CacheManager

put

public void put(java.lang.Object query,
                java.lang.Object resource)
Put an object in the cache
Specified by:
put in interface CacheManager

invalidate

public void invalidate(java.lang.Object query)
Invalidate an entry in the cache.
Specified by:
invalidate in interface CacheManager

supportsReload

public boolean supportsReload()
This manager supports reloading and so this returns true.
Specified by:
supportsReload in interface CacheManager

getResourceType

public java.lang.String getResourceType()
Returns the wm type of resource it is caching.

getMetrics

public long[] getMetrics()
Returns cache instrumentation statistics.

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

See Also:
org.opendoors.cache.impl.CacheImpl