1 |
| package org.jboss.cache.loader; |
2 |
| |
3 |
| import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig; |
4 |
| import org.jboss.cache.config.Dynamic; |
5 |
| |
6 |
| import java.util.Properties; |
7 |
| |
8 |
| public class ClusteredCacheLoaderConfig extends IndividualCacheLoaderConfig |
9 |
| { |
10 |
| |
11 |
| |
12 |
| |
13 |
| private static final long serialVersionUID = -3425487656984237468L; |
14 |
| |
15 |
| @Dynamic |
16 |
| private long timeout = 10000; |
17 |
| |
18 |
0
| public ClusteredCacheLoaderConfig()
|
19 |
| { |
20 |
0
| setClassName(ClusteredCacheLoader.class.getName());
|
21 |
| } |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
24
| ClusteredCacheLoaderConfig(IndividualCacheLoaderConfig base)
|
29 |
| { |
30 |
24
| setClassName(ClusteredCacheLoader.class.getName());
|
31 |
24
| populateFromBaseConfig(base);
|
32 |
| } |
33 |
| |
34 |
120054
| public long getTimeout()
|
35 |
| { |
36 |
120054
| return timeout;
|
37 |
| } |
38 |
| |
39 |
0
| public void setTimeout(long timeout)
|
40 |
| { |
41 |
0
| testImmutability("timeout");
|
42 |
0
| this.timeout = timeout;
|
43 |
| } |
44 |
| |
45 |
24
| public void setProperties(Properties props)
|
46 |
| { |
47 |
24
| super.setProperties(props);
|
48 |
24
| try
|
49 |
| { |
50 |
24
| timeout = Long.valueOf(props.getProperty("timeout"));
|
51 |
| } |
52 |
| catch (Exception e) |
53 |
| { |
54 |
0
| log.info("Using default value for config property 'timeout' - " + timeout);
|
55 |
| } |
56 |
| } |
57 |
| |
58 |
0
| public boolean equals(Object obj)
|
59 |
| { |
60 |
0
| if (obj instanceof ClusteredCacheLoaderConfig && equalsExcludingProperties(obj))
|
61 |
| { |
62 |
0
| ClusteredCacheLoaderConfig other = (ClusteredCacheLoaderConfig) obj;
|
63 |
0
| return (this.timeout == other.timeout);
|
64 |
| } |
65 |
0
| return false;
|
66 |
| } |
67 |
| |
68 |
24
| public int hashCode()
|
69 |
| { |
70 |
24
| return 31 * hashCodeExcludingProperties() + (int) timeout;
|
71 |
| } |
72 |
| |
73 |
| } |