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 FIFOConfiguration extends EvictionPolicyConfigBase |
28 |
| { |
29 |
| |
30 |
| private static final long serialVersionUID = -7229715009546277313L; |
31 |
| |
32 |
29
| public FIFOConfiguration()
|
33 |
| { |
34 |
29
| super();
|
35 |
| |
36 |
29
| setMaxNodes(-1);
|
37 |
| } |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
| |
43 |
79
| @Override
|
44 |
| public void validate() throws ConfigurationException |
45 |
| { |
46 |
79
| if (getMaxNodes() < 0)
|
47 |
| { |
48 |
1
| throw new ConfigurationException("maxNodes must be must be " +
|
49 |
| "configured to a value greater than or equal to 0"); |
50 |
| } |
51 |
| } |
52 |
| |
53 |
0
| public String toString()
|
54 |
| { |
55 |
0
| StringBuffer ret = new StringBuffer();
|
56 |
0
| ret.append("LFUConfiguration: maxNodes = ").append(getMaxNodes());
|
57 |
0
| return ret.toString();
|
58 |
| } |
59 |
| |
60 |
0
| @Override
|
61 |
| public boolean equals(Object obj) |
62 |
| { |
63 |
0
| return (obj instanceof FIFOConfiguration && super.equals(obj));
|
64 |
| } |
65 |
| |
66 |
29
| @Override
|
67 |
| protected void setEvictionPolicyClassName() |
68 |
| { |
69 |
29
| setEvictionPolicyClass(FIFOPolicy.class.getName());
|
70 |
| } |
71 |
| |
72 |
27
| @Override
|
73 |
| public void reset() |
74 |
| { |
75 |
27
| setMaxNodes(-1);
|
76 |
| } |
77 |
| } |