1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.jboss.cache.eviction; |
8 |
| |
9 |
| import org.jboss.cache.config.ConfigurationException; |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class MRUConfiguration extends EvictionPolicyConfigBase |
28 |
| { |
29 |
| |
30 |
| private static final long serialVersionUID = -8734577898966155218L; |
31 |
| |
32 |
18
| public MRUConfiguration()
|
33 |
| { |
34 |
18
| super();
|
35 |
| |
36 |
18
| setMaxNodes(-1);
|
37 |
| } |
38 |
| |
39 |
18
| @Override
|
40 |
| protected void setEvictionPolicyClassName() |
41 |
| { |
42 |
18
| setEvictionPolicyClass(MRUPolicy.class.getName());
|
43 |
| } |
44 |
| |
45 |
| |
46 |
| |
47 |
| |
48 |
| |
49 |
| |
50 |
46
| @Override
|
51 |
| public void validate() throws ConfigurationException |
52 |
| { |
53 |
46
| if (getMaxNodes() < 0)
|
54 |
1
| throw new ConfigurationException("maxNodes not configured");
|
55 |
| } |
56 |
| |
57 |
0
| public String toString()
|
58 |
| { |
59 |
0
| StringBuffer str = new StringBuffer();
|
60 |
0
| str.append("MRUConfiguration: ").
|
61 |
| append(" maxNodes =").append(getMaxNodes()); |
62 |
0
| return str.toString();
|
63 |
| } |
64 |
| |
65 |
0
| @Override
|
66 |
| public boolean equals(Object obj) |
67 |
| { |
68 |
0
| return (obj instanceof MRUConfiguration && super.equals(obj));
|
69 |
| } |
70 |
| |
71 |
17
| @Override
|
72 |
| public void reset() |
73 |
| { |
74 |
17
| setMaxNodes(-1);
|
75 |
| } |
76 |
| |
77 |
| } |