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

java.lang.Object
  extended by fr.paris.lutece.plugins.comarquage.util.cache.genericimpl.ContextChainManagerImpl
All Implemented Interfaces:
IChainManager, IContextChainManager

public class ContextChainManagerImpl
extends java.lang.Object
implements IContextChainManager

The default context cache filter associated with ContextChainManagerImpl

See Also:
ChainManagerImpl

Constructor Summary
ContextChainManagerImpl(IChainManager filterManager, java.lang.String strFilterName, java.lang.String strNextFilter, java.io.Serializable initialKey)
          Public constructor
 
Method Summary
 java.lang.Object callFilter(java.lang.String strInstanceName, java.io.Serializable key)
          Call the instanceName filter/cache
 java.lang.Object callNextFilter(java.io.Serializable key, java.lang.Object element)
          Call the next filter in chain
 void emptyCaches()
          Finds all the caches and flush them
 int getCachesSize()
          get the sum of all cache sizes
 java.lang.String getCurrentFilterName()
          Return the name of the current filter
 IChainNode getFilter(java.lang.String strInstanceName)
          Return the filter named instanceName
A RuntimeException will be throw if no cache/filter exist with this name.
 java.io.Serializable getIntialKey()
          Return the intial Key
 java.lang.String getNextFilterName()
          Return the name of the next filter
 java.lang.String getPluginName()
          Return the plugin name which the filter is associated
 void init(java.lang.String strBase)
          Init the instance with params based on prefix strBase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextChainManagerImpl

public ContextChainManagerImpl(IChainManager filterManager,
                               java.lang.String strFilterName,
                               java.lang.String strNextFilter,
                               java.io.Serializable initialKey)
Public constructor

Parameters:
filterManager - the filter manager
strFilterName - the filter name
strNextFilter - the next filter in the chain
initialKey - the innitial key
Method Detail

init

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

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

callFilter

public java.lang.Object callFilter(java.lang.String strInstanceName,
                                   java.io.Serializable key)
Description copied from interface: IChainManager
Call the instanceName filter/cache

Specified by:
callFilter in interface IChainManager
Parameters:
strInstanceName - Name of the filter
key - Key of the object
Returns:
Object searched or null if no object found
See Also:
IChainManager.callFilter(String, Serializable)

getFilter

public IChainNode getFilter(java.lang.String strInstanceName)
Description copied from interface: IChainManager
Return the filter named instanceName
A RuntimeException will be throw if no cache/filter exist with this name.

Specified by:
getFilter in interface IChainManager
Parameters:
strInstanceName - Name of the filter
Returns:
Cache/Filter searched
See Also:
IChainManager.getFilter(String)

callNextFilter

public java.lang.Object callNextFilter(java.io.Serializable key,
                                       java.lang.Object element)
Description copied from interface: IContextChainManager
Call the next filter in chain

Specified by:
callNextFilter in interface IContextChainManager
Parameters:
key - The key of the element
element - The element to filter or null if search in cache is needed
Returns:
The object filtered or the object finded in cache
See Also:
IContextChainManager.callNextFilter(Serializable, Object)

getPluginName

public java.lang.String getPluginName()
Description copied from interface: IChainManager
Return the plugin name which the filter is associated

Specified by:
getPluginName in interface IChainManager
Returns:
the plugin name which the filter is associated
See Also:
IChainManager.getPluginName()

getCurrentFilterName

public java.lang.String getCurrentFilterName()
Description copied from interface: IContextChainManager
Return the name of the current filter

Specified by:
getCurrentFilterName in interface IContextChainManager
Returns:
the name of the current filter
See Also:
IContextChainManager.getCurrentFilterName()

getNextFilterName

public java.lang.String getNextFilterName()
Description copied from interface: IContextChainManager
Return the name of the next filter

Specified by:
getNextFilterName in interface IContextChainManager
Returns:
the name of the next filter
See Also:
IContextChainManager.getNextFilterName()

getIntialKey

public java.io.Serializable getIntialKey()
Description copied from interface: IContextChainManager
Return the intial Key

Specified by:
getIntialKey in interface IContextChainManager
Returns:
the initial key
See Also:
IContextChainManager.getIntialKey()

emptyCaches

public void emptyCaches()
Description copied from interface: IChainManager
Finds all the caches and flush them

Specified by:
emptyCaches in interface IChainManager
See Also:
IChainManager.emptyCaches()

getCachesSize

public int getCachesSize()
Description copied from interface: IChainManager
get the sum of all cache sizes

Specified by:
getCachesSize in interface IChainManager
Returns:
the cumuled caches size
See Also:
IChainManager.getCachesSize()


Copyright © 2008 Mairie de Paris. All Rights Reserved.