org.mmbase.cache
Class ConstraintsMatchingStrategy
java.lang.Object
org.mmbase.cache.ReleaseStrategy
org.mmbase.cache.ConstraintsMatchingStrategy
public class ConstraintsMatchingStrategy
- extends ReleaseStrategy
This strategy will evaluate the constraint on a a query object against a NodeEvent. It will apply the following rules:
new node/delete node
- If the step of a constraint matches the type of the event, and the values of the node don't fall within the
constraint: don't flush.
- If the step of a constraint matches the type of the event, and the values of the node don't fall within the
constraint: flush.
- If no constraints have a step matching the type of the event: flush.
change node Like the above, but an extra check has to be made:
- if the node previously fell within the constraints but now doesn't: flush
- if the node previously didn't fall within the constraints but now does: flush
- Since:
- MMBase-1.8
- Version:
- $Id: ConstraintsMatchingStrategy.java 36364 2009-06-24 17:55:56Z michiel $
- Author:
- Ernst Bunders
| Methods inherited from class org.mmbase.cache.ReleaseStrategy |
clear, equals, evaluate, evaluate, getAvgEvaluationTimeInMilis, getConstraintsForField, getSortordersForField, getTotalEvaluated, getTotalEvaluationTimeMillis, getTotalPreserved, hashCode, isEnabled, setEnabled, toString |
ConstraintsMatchingStrategy
public ConstraintsMatchingStrategy()
getName
public String getName()
- Specified by:
getName in class ReleaseStrategy
getDescription
public String getDescription()
- Specified by:
getDescription in class ReleaseStrategy
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
findMatcherForConstraint
protected static final ConstraintsMatchingStrategy.AbstractConstraintMatcher findMatcherForConstraint(Constraint constraint)
throws InvocationTargetException,
NoSuchMethodException,
InstantiationException,
IllegalAccessException
- This method will find a constraint matcher that supports the given constraint, and will return the
UnsupportedConstraintMatcher if none is found.
- Parameters:
constraint -
- Throws:
InvocationTargetException
NoSuchMethodException
InstantiationException
IllegalAccessException
MMBase 2.0-SNAPSHOT - null