org.apache.cocoon.caching.impl
Class CacheImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.caching.impl.CacheImpl
All Implemented Interfaces:
Disposable, Component, LogEnabled, Parameterizable, Serviceable, ThreadSafe, Cache
Direct Known Subclasses:
EventAwareCacheImpl

public class CacheImpl
extends AbstractLogEnabled
implements Cache, ThreadSafe, Serviceable, Disposable, Parameterizable

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:
CVS $Id: CacheImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Field Summary
protected  ServiceManager manager
          The service manager
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
 void dispose()
          Disposable Interface
 CachedResponse get(Serializable key)
          Get a cached response.
 void parameterize(Parameters parameters)
           
 void remove(Serializable key)
          Remove a cached response.
 void service(ServiceManager manager)
          Serviceable Interface
 void store(Serializable key, CachedResponse response)
          Store a cached response
 
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

store

protected Store store
The store containing the cached responses


manager

protected ServiceManager manager
The service manager

Constructor Detail

CacheImpl

public CacheImpl()
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Serviceable Interface

Specified by:
service in interface Serviceable
Throws:
ServiceException

dispose

public void dispose()
Disposable Interface

Specified by:
dispose in interface Disposable

store

public void store(Serializable key,
                  CachedResponse response)
           throws ProcessingException
Store a cached response

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

get

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

Specified by:
get in interface 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 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 Cache

containsKey

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

Specified by:
containsKey in interface Cache

parameterize

public void parameterize(Parameters parameters)
                  throws ParameterException
Specified by:
parameterize in interface Parameterizable
Throws:
ParameterException


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