|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Policy
An eviction policy.
The Cache will use a policy at startup. There are three policy implementations provided in ehcache: LRU, LFU and FIFO. However many other policies are possible. That the policy has access to the whole element enables policies based on the key, value, metadata, statistics, or a combination of any of the above.
| Method Summary | |
|---|---|
boolean |
compare(Element element1,
Element element2)
Compares the desirableness for eviction of two elements |
String |
getName()
|
Element |
selectedBasedOnPolicy(Element[] sampledElements,
Element justAdded)
Finds the best eviction candidate based on the sampled elements. |
| Method Detail |
|---|
String getName()
Element selectedBasedOnPolicy(Element[] sampledElements,
Element justAdded)
sampledElements - this should be a random subset of the populationjustAdded - we probably never want to select the element just added.
It is provided so that it can be ignored if selected. May be null.
boolean compare(Element element1,
Element element2)
element1 - the element to compare againstelement2 - the element to compare
|
ehcache | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||