1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.jboss.cache.eviction; |
8 |
| |
9 |
| import org.jboss.cache.Fqn; |
10 |
| import org.jboss.cache.Region; |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| public class MRUAlgorithm extends BaseEvictionAlgorithm |
24 |
| { |
25 |
11
| protected EvictionQueue setupEvictionQueue(Region region) throws EvictionException
|
26 |
| { |
27 |
11
| return new MRUQueue();
|
28 |
| } |
29 |
| |
30 |
10342
| protected boolean shouldEvictNode(NodeEntry ne)
|
31 |
| { |
32 |
10342
| MRUConfiguration config = (MRUConfiguration) region.getEvictionPolicyConfig();
|
33 |
10342
| return evictionQueue.getNumberOfNodes() > config.getMaxNodes();
|
34 |
| } |
35 |
| |
36 |
4
| protected void processVisitedNodes(Fqn fqn) throws EvictionException
|
37 |
| { |
38 |
4
| super.processVisitedNodes(fqn);
|
39 |
4
| ((MRUQueue) evictionQueue).moveToTopOfStack(fqn);
|
40 |
| } |
41 |
| } |