org.mmbase.cache
Class ChainedReleaseStrategy

Package class diagram package ChainedReleaseStrategy
java.lang.Object
  extended by org.mmbase.cache.ReleaseStrategy
      extended by org.mmbase.cache.ChainedReleaseStrategy
All Implemented Interfaces:
Iterable<ReleaseStrategy>

public class ChainedReleaseStrategy
extends ReleaseStrategy
implements Iterable<ReleaseStrategy>

This class will manage a collection of ReleaseStrategy instances, and call them hierarchically.

Since:
MMBase-1.8
Version:
$Id: ChainedReleaseStrategy.java 45315 2011-02-18 20:23:11Z michiel $
Author:
Ernst Bunders

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.cache.ReleaseStrategy
ReleaseStrategy.StrategyResult
 
Constructor Summary
ChainedReleaseStrategy(ReleaseStrategy... rs)
           
 
Method Summary
 void addReleaseStrategy(ReleaseStrategy strategy)
          Adds the strategy if it is not already there.
 void clear()
           
protected  boolean doEvaluate(NodeEvent event, SearchQuery query, List<MMObjectNode> cachedResult)
          implement this method to create your own strategy.
protected  boolean doEvaluate(RelationEvent event, SearchQuery query, List<MMObjectNode> cachedResult)
          implement this method to create your own strategy.
 void fillFromXml(Element element)
           
 String getDescription()
           
 List<ReleaseStrategy> getList()
           
 String getName()
           
 Iterator<ReleaseStrategy> iterator()
           
 void removeAllStrategies()
          removes all strategies
 void removeStrategy(ReleaseStrategy strategy)
           
 void setEnabled(boolean newStatus)
          This method provides a way of globally switching off all strategies this one wraps.
 int size()
           
 String toString()
           
 
Methods inherited from class org.mmbase.cache.ReleaseStrategy
equals, evaluate, evaluate, getAvgEvaluationTimeInMilis, getConstraintsForField, getSortordersForField, getTotalEvaluated, getTotalEvaluationTimeMillis, getTotalPreserved, hashCode, isEnabled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedReleaseStrategy

public ChainedReleaseStrategy(ReleaseStrategy... rs)
Method Detail

fillFromXml

public void fillFromXml(Element element)
Since:
MMBase-1.8.6

setEnabled

public void setEnabled(boolean newStatus)
This method provides a way of globally switching off all strategies this one wraps. When this strategy is set to 'disabled', the state of all wrapped strategies is being preserved, so when it is being 'enabled' again, these settings are restored, in stead of just setting all wrapped strategies to 'enabled'.

Overrides:
setEnabled in class ReleaseStrategy

addReleaseStrategy

public void addReleaseStrategy(ReleaseStrategy strategy)
Adds the strategy if it is not already there. Strategies should only occur once.

Parameters:
strategy -

removeStrategy

public void removeStrategy(ReleaseStrategy strategy)

removeAllStrategies

public void removeAllStrategies()
removes all strategies


getName

public String getName()
Specified by:
getName in class ReleaseStrategy

getDescription

public String getDescription()
Specified by:
getDescription in class ReleaseStrategy

iterator

public Iterator<ReleaseStrategy> iterator()
Specified by:
iterator in interface Iterable<ReleaseStrategy>

getList

public List<ReleaseStrategy> getList()
Since:
MMBase-1.9

doEvaluate

protected final boolean doEvaluate(NodeEvent event,
                                   SearchQuery query,
                                   List<MMObjectNode> cachedResult)
Description copied from class: ReleaseStrategy
implement this method to create your own strategy.

Specified by:
doEvaluate in class ReleaseStrategy
Parameters:
event - a node event
Returns:
true if the cache entry should be released

doEvaluate

protected final boolean doEvaluate(RelationEvent event,
                                   SearchQuery query,
                                   List<MMObjectNode> cachedResult)
Description copied from class: ReleaseStrategy
implement this method to create your own strategy.

Specified by:
doEvaluate in class ReleaseStrategy
Parameters:
event - a relation event
Returns:
true if the cache entry should be released

clear

public void clear()
Overrides:
clear in class ReleaseStrategy

size

public int size()
Since:
MMBase-1.8.1

toString

public String toString()
Overrides:
toString in class ReleaseStrategy


MMBase2 Core 2.0-SNAPSHOT - 2013-11-29T11:08