org.apache.cocoon.caching.impl
Class CacheImpl

java.lang.Object
  extended byorg.apache.cocoon.caching.impl.CacheImpl
All Implemented Interfaces:
org.apache.cocoon.caching.Cache

public class CacheImpl
extends Object
implements org.apache.cocoon.caching.Cache

This is the Cocoon cache. This component is responsible for storing and retrieving cached responses. It can be used to monitor the cache or the investigate which responses are cached etc. This component will grow!

Since:
2.1
Version:
$Id: CacheImpl.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  Store store
          The store containing the cached responses
 
Fields inherited from interface org.apache.cocoon.caching.Cache
ROLE
 
Constructor Summary
CacheImpl()
           
 
Method Summary
 void clear()
          clear cache of all cached responses
 boolean containsKey(Serializable key)
          See if a response is cached under this key
 org.apache.cocoon.caching.CachedResponse get(Serializable key)
          Get a cached response.
protected  Log getLogger()
           
 void remove(Serializable key)
          Remove a cached response.
 void setStore(Store store)
          Set the Store implementation
 void store(Serializable key, org.apache.cocoon.caching.CachedResponse response)
          Store a cached response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

protected Store store
The store containing the cached responses

Constructor Detail

CacheImpl

public CacheImpl()
Method Detail

store

public void store(Serializable key,
                  org.apache.cocoon.caching.CachedResponse response)
           throws org.apache.cocoon.ProcessingException
Store a cached response

Specified by:
store in interface org.apache.cocoon.caching.Cache
Parameters:
key - the key used by the caching algorithm to identify the request
response - the cached response
Throws:
org.apache.cocoon.ProcessingException

get

public org.apache.cocoon.caching.CachedResponse get(Serializable key)
Get a cached response. If it is not available null is returned.

Specified by:
get in interface org.apache.cocoon.caching.Cache
Parameters:
key - the key used by the caching algorithm to identify the request

remove

public void remove(Serializable key)
Remove a cached response. If it is not available no operation is performed.

Specified by:
remove in interface org.apache.cocoon.caching.Cache
Parameters:
key - the key used by the caching algorithm to identify the request

clear

public void clear()
clear cache of all cached responses

Specified by:
clear in interface org.apache.cocoon.caching.Cache

containsKey

public boolean containsKey(Serializable key)
See if a response is cached under this key

Specified by:
containsKey in interface org.apache.cocoon.caching.Cache

setStore

public void setStore(Store store)
Set the Store implementation


getLogger

protected Log getLogger()


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.