org.springframework.extensions.surf.cache
Class ModelObjectCache
java.lang.Object
org.springframework.extensions.surf.cache.BasicCache<ModelObject>
org.springframework.extensions.surf.cache.ModelObjectCache
- All Implemented Interfaces:
- ContentCache<ModelObject>
public class ModelObjectCache
- extends BasicCache<ModelObject>
An enhancement to the in-memory basic cache that considers the in-memory
cache to be secondary to the status of content within a persisted
store. The persisted store is a Store implementation that is checked
in order to verify that the content is still valid in the cache.
The delay between checks against the persistent store can be configured.
- Author:
- muzquiano, kevinr
Fields inherited from class org.springframework.extensions.surf.cache.BasicCache |
cache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
store
protected final Store store
ModelObjectCache
public ModelObjectCache(Store store,
long delay)
- Instantiates a new model object cache.
- Parameters:
store
- the storedelay
- the delay to check modified dates for items in the cache
ModelObjectCache
public ModelObjectCache(Store store,
long timeout,
long delay)
- Instantiates a new model object cache.
- Parameters:
store
- the storetimeout
- the timeoutdelay
- the delay to check modified dates for items in the cache
get
public ModelObject get(String key)
- Description copied from interface:
ContentCache
- Gets content stored in the cache
- Specified by:
get
in interface ContentCache<ModelObject>
- Overrides:
get
in class BasicCache<ModelObject>
- Parameters:
key
- the key
- Returns:
- the object
Copyright © 2009 SpringSource, Inc. All Rights Reserved.