org.webmacro.resource
Class TrivialCacheManager

java.lang.Object
  extended byorg.webmacro.resource.TrivialCacheManager
All Implemented Interfaces:
CacheManager

public class TrivialCacheManager
extends java.lang.Object
implements CacheManager


Constructor Summary
TrivialCacheManager()
           
 
Method Summary
 void destroy()
          Same as defined in Provider
 void flush()
          Same as defined in Provider
 java.lang.Object get(java.lang.Object query)
          Called to get a resource from the cache.
 java.lang.Object get(java.lang.Object query, ResourceLoader helper)
          Called to get a resource from the cache.
 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)
          Invalidates an entry in the cache.
 void put(java.lang.Object query, java.lang.Object resource)
          Called to put a resource into the cache.
 boolean supportsReload()
          Does this cache manager support reloading of resources if the underlying resource has changed?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrivialCacheManager

public TrivialCacheManager()
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
Throws:
InitException

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
Description copied from interface: CacheManager
Called to get a resource from the cache. The helper object is used to load the resource if the resource was not in the cache.

Specified by:
get in interface CacheManager
Throws:
ResourceException

get

public java.lang.Object get(java.lang.Object query)
Description copied from interface: CacheManager
Called to get a resource from the cache. Returns null if not present.

Specified by:
get in interface CacheManager

put

public void put(java.lang.Object query,
                java.lang.Object resource)
Description copied from interface: CacheManager
Called to put a resource into the cache.

Specified by:
put in interface CacheManager

supportsReload

public boolean supportsReload()
Description copied from interface: CacheManager
Does this cache manager support reloading of resources if the underlying resource has changed?

Specified by:
supportsReload in interface CacheManager

invalidate

public void invalidate(java.lang.Object query)
Description copied from interface: CacheManager
Invalidates an entry in the cache. Depending on the the implementation, the actual removal from the cache may or may not be immediate.

Specified by:
invalidate in interface CacheManager