|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.cache.ReleaseStrategy
This class is the base for all cache release strategies. You should extend this to create your own. It will contain a number of usefull utility methods to analyze query objecs and cached search results. Feel free to add those In case you miss one developing your own strategies.
| Nested Class Summary | |
static class |
ReleaseStrategy.StrategyResult
|
protected static class |
ReleaseStrategy.Timer
|
| Constructor Summary | |
ReleaseStrategy()
|
|
| Method Summary | |
void |
clear()
|
protected abstract boolean |
doEvaluate(NodeEvent event,
SearchQuery query,
List cachedResult)
implement this method to create your own strategy. |
protected abstract boolean |
doEvaluate(RelationEvent event,
SearchQuery query,
List cachedResult)
implement this method to create your own strategy. |
boolean |
equals(Object ob)
|
ReleaseStrategy.StrategyResult |
evaluate(NodeEvent event,
SearchQuery query,
List cachedResult)
This method checks if evaluation should happen (active), keeps the time of the operation and updates the statistics. |
ReleaseStrategy.StrategyResult |
evaluate(RelationEvent event,
SearchQuery query,
List cachedResult)
|
int |
getAvgEvaluationTimeInMilis()
|
protected static List |
getConstraintsForField(String fieldName,
MMObjectBuilder builder,
Constraint constraint,
SearchQuery query)
utility for specializations: get all the constraints in the query that apply to a certain field |
abstract String |
getDescription()
|
protected static List |
getFieldSteps(SearchQuery query)
utility for specializations: get all the field steps of a query |
abstract String |
getName()
|
protected static List |
getSortordersForField(String fieldName,
MMObjectBuilder builder,
List sortOrders,
SearchQuery query)
utility for specializations: get all the sortorders in the query that apply to a certain field |
int |
getTotalEvaluated()
|
long |
getTotalEvaluationTimeMillis()
|
int |
getTotalPreserved()
|
int |
hashCode()
|
boolean |
isEnabled()
|
void |
setEnabled(boolean newStatus)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ReleaseStrategy()
| Method Detail |
public abstract String getName()
public abstract String getDescription()
public int getAvgEvaluationTimeInMilis()
public long getTotalEvaluationTimeMillis()
public final ReleaseStrategy.StrategyResult evaluate(NodeEvent event,
SearchQuery query,
List cachedResult)
doEvaluate(NodeEvent event, SearchQuery query, List cachedResult).
public final ReleaseStrategy.StrategyResult evaluate(RelationEvent event,
SearchQuery query,
List cachedResult)
public int getTotalPreserved()
public int getTotalEvaluated()
protected abstract boolean doEvaluate(NodeEvent event,
SearchQuery query,
List cachedResult)
event - a node eventquery - cachedResult -
protected abstract boolean doEvaluate(RelationEvent event,
SearchQuery query,
List cachedResult)
event - a relation eventquery - cachedResult -
public void setEnabled(boolean newStatus)
public boolean isEnabled()
public void clear()
public boolean equals(Object ob)
public int hashCode()
public String toString()
protected static List getConstraintsForField(String fieldName,
MMObjectBuilder builder,
Constraint constraint,
SearchQuery query)
fieldName - builder - constraint - query -
protected static List getSortordersForField(String fieldName,
MMObjectBuilder builder,
List sortOrders,
SearchQuery query)
fieldName - builder - sortOrders - query - protected static List getFieldSteps(SearchQuery query)
query -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||