fr.paris.lutece.plugins.comarquage.util.cache.genericimpl
Class AbstractCache

java.lang.Object
  extended by fr.paris.lutece.plugins.comarquage.util.cache.genericimpl.AbstractChainNode
      extended by fr.paris.lutece.plugins.comarquage.util.cache.genericimpl.AbstractCache
All Implemented Interfaces:
IChainNode
Direct Known Subclasses:
DiskCache, MemCache

public abstract class AbstractCache
extends AbstractChainNode

Common abstract cache
Properties read here:


Constructor Summary
AbstractCache(java.lang.String strImplementationName, java.lang.String strImplementationDescription)
          The public constructor
 
Method Summary
abstract  void doFlush()
          Empty a cache
abstract  java.lang.Object doSearch(IContextChainManager filterManager, java.io.Serializable key)
          Realise the search of the object
abstract  void doStore(IContextChainManager filterManager, java.io.Serializable key, java.lang.Object element)
          Ask to store an object (normally not present in cache)
abstract  int getCacheSize()
          get the number of items in cache
 java.lang.Object getObject(IContextChainManager filterManager, java.io.Serializable key, java.lang.Object element)
          Research an object in the cache section
If cache/filter find the object from a "source", he must call @link #doFilter(IContextChainManager, Serializable, Object) before returning the object.
 void init(java.lang.String strBase)
          Init the instance with params based on prefix strBase
 
Methods inherited from class fr.paris.lutece.plugins.comarquage.util.cache.genericimpl.AbstractChainNode
getImplementationDescription, getImplementationName, readInitKeyAdapter, readInitObjectTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCache

public AbstractCache(java.lang.String strImplementationName,
                     java.lang.String strImplementationDescription)
The public constructor

Parameters:
strImplementationName - the name of the implementation class
strImplementationDescription - the description of the implementation
Method Detail

init

public void init(java.lang.String strBase)
Description copied from interface: IChainNode
Init the instance with params based on prefix strBase

Specified by:
init in interface IChainNode
Overrides:
init in class AbstractChainNode
Parameters:
strBase - The prefix of params to search
See Also:
IChainNode.init(String)

getObject

public final java.lang.Object getObject(IContextChainManager filterManager,
                                        java.io.Serializable key,
                                        java.lang.Object element)
Description copied from interface: IChainNode
Research an object in the cache section
If cache/filter find the object from a "source", he must call @link #doFilter(IContextChainManager, Serializable, Object) before returning the object.

Parameters:
filterManager - Context calling manager (needed to call some service or next element in filter's chain)
key - The unique key of object
element - The element to work (null if no element given)
Returns:
The resolved object or null if no object found
See Also:
IChainNode.getObject(IContextChainManager, Serializable, Object)

doSearch

public abstract java.lang.Object doSearch(IContextChainManager filterManager,
                                          java.io.Serializable key)
Realise the search of the object

Parameters:
filterManager - The context filter/cache manager, used to call next filter or ask parameters
key - the key of the element
Returns:
the element in cache

doStore

public abstract void doStore(IContextChainManager filterManager,
                             java.io.Serializable key,
                             java.lang.Object element)
Ask to store an object (normally not present in cache)

Parameters:
filterManager - The context filter/cache manager, used to call next filter or ask parameters
key - the key of the element
element - the element to store

doFlush

public abstract void doFlush()
Empty a cache


getCacheSize

public abstract int getCacheSize()
get the number of items in cache

Returns:
the cache size


Copyright © 2008 Mairie de Paris. All Rights Reserved.