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

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

public class ChainManagerImpl
extends java.lang.Object
implements IChainManager

The main default cache/filter manager


Constructor Summary
ChainManagerImpl(java.lang.String strPluginName)
          Public constructor
 
Method Summary
 void addFilter(java.lang.String strInstanceName, IChainNode filter)
          Add filter to map
 void addFilter(java.lang.String strInstanceName, IChainNode filter, java.lang.String strNextFilter)
          Add filter and next filter to maps
 java.lang.Object callFilter(java.lang.String strInstanceName, java.io.Serializable key)
          Call the instanceName filter/cache
protected  java.lang.Object callFilter(java.lang.String strInstanceName, java.io.Serializable key, java.lang.Object element)
          Call a filter
 void emptyCaches()
          Finds all the caches and flush them
 int getCachesSize()
          get the sum of all cache sizes
 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.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

ChainManagerImpl

public ChainManagerImpl(java.lang.String strPluginName)
Public constructor

Parameters:
strPluginName - the plugin name
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)

addFilter

public void addFilter(java.lang.String strInstanceName,
                      IChainNode filter)
Add filter to map

Parameters:
strInstanceName - the name of the concerned instance
filter - the filter to add to the map

addFilter

public void addFilter(java.lang.String strInstanceName,
                      IChainNode filter,
                      java.lang.String strNextFilter)
Add filter and next filter to maps

Parameters:
strInstanceName - the name of the concerned instance
filter - the filter to add to the map of filters
strNextFilter - the name of the filter to add to the map of next filters

callFilter

protected java.lang.Object callFilter(java.lang.String strInstanceName,
                                      java.io.Serializable key,
                                      java.lang.Object element)
Call a filter

Parameters:
strInstanceName - the name of the concerned instance
key - The unique key of object
element - The element to work
Returns:
The resolved object or null if no object found

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(java.lang.String, java.io.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)

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()

emptyCaches

public void emptyCaches()
Finds all the caches and flush them

Specified by:
emptyCaches in interface IChainManager

getCachesSize

public int getCachesSize()
get the sum of all cache sizes

Specified by:
getCachesSize in interface IChainManager
Returns:
the sum of all cache sizes


Copyright © 2008 Mairie de Paris. All Rights Reserved.