|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.caching.impl.CacheImpl
org.apache.cocoon.caching.SimpleCache
This cache implementation is an extension to the default cache implementation. If a response is not found in the cache or is invalid, it also checks the file system for a cached response. This allows to update the cache information by running batch processes.
Field Summary | |
protected String |
baseDirectory
The base directory |
protected Map |
locks
|
Fields inherited from class org.apache.cocoon.caching.impl.CacheImpl |
manager, store |
Fields inherited from interface org.apache.cocoon.caching.Cache |
ROLE |
Constructor Summary | |
SimpleCache()
|
Method Summary | |
void |
clear()
clear cache of all cached responses |
boolean |
containsKey(Serializable key)
See if a response is cached under this key |
protected byte[] |
get(File file)
Get the content from a file |
CachedResponse |
get(Serializable key)
Get a cached response. |
protected File |
getFile(Serializable key)
Get the filename |
void |
parameterize(Parameters parameters)
|
void |
remove(Serializable key)
Remove a cached response. |
protected void |
store(File file,
byte[] content)
store the content in a file |
void |
store(Serializable key,
CachedResponse response)
Store a cached response |
Methods inherited from class org.apache.cocoon.caching.impl.CacheImpl |
dispose, service |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String baseDirectory
protected Map locks
Constructor Detail |
public SimpleCache()
Method Detail |
public void parameterize(Parameters parameters) throws ParameterException
parameterize
in interface Parameterizable
parameterize
in class CacheImpl
ParameterException
protected File getFile(Serializable key)
public void clear()
CacheImpl
clear
in interface Cache
clear
in class CacheImpl
public boolean containsKey(Serializable key)
CacheImpl
containsKey
in interface Cache
containsKey
in class CacheImpl
public CachedResponse get(Serializable key)
CacheImpl
null
is returned.
get
in interface Cache
get
in class CacheImpl
key
- the key used by the caching algorithm to identify the
requestpublic void remove(Serializable key)
CacheImpl
remove
in interface Cache
remove
in class CacheImpl
key
- the key used by the caching algorithm to identify the
requestpublic void store(Serializable key, CachedResponse response) throws ProcessingException
CacheImpl
store
in interface Cache
store
in class CacheImpl
key
- the key used by the caching algorithm to identify the
requestresponse
- the cached response
ProcessingException
protected void store(File file, byte[] content)
protected byte[] get(File file)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |