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 FileCacheLoaderConfig extends IndividualCacheLoaderConfig |
9 |
| { |
10 |
| private static final long serialVersionUID = 4626734068542420865L; |
11 |
| |
12 |
| private String location; |
13 |
| @Dynamic |
14 |
| private boolean checkCharacterPortability = true; |
15 |
| |
16 |
2
| public FileCacheLoaderConfig()
|
17 |
| { |
18 |
2
| setClassName(FileCacheLoader.class.getName());
|
19 |
| } |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
363
| FileCacheLoaderConfig(IndividualCacheLoaderConfig base)
|
27 |
| { |
28 |
363
| setClassName(FileCacheLoader.class.getName());
|
29 |
363
| populateFromBaseConfig(base);
|
30 |
| } |
31 |
| |
32 |
368
| public String getLocation()
|
33 |
| { |
34 |
368
| return location;
|
35 |
| } |
36 |
| |
37 |
366
| public void setLocation(String location)
|
38 |
| { |
39 |
366
| testImmutability("location");
|
40 |
366
| this.location = location;
|
41 |
| } |
42 |
| |
43 |
1484
| public boolean isCheckCharacterPortability()
|
44 |
| { |
45 |
1484
| return checkCharacterPortability;
|
46 |
| } |
47 |
| |
48 |
366
| public void setCheckCharacterPortability(boolean checkCharacterPortability)
|
49 |
| { |
50 |
366
| testImmutability("check.character.portability");
|
51 |
366
| this.checkCharacterPortability = checkCharacterPortability;
|
52 |
| } |
53 |
| |
54 |
367
| public void setProperties(Properties props)
|
55 |
| { |
56 |
367
| super.setProperties(props);
|
57 |
| |
58 |
367
| if (props != null)
|
59 |
| { |
60 |
366
| setLocation(props.getProperty("location"));
|
61 |
366
| String prop = props.getProperty("check.character.portability");
|
62 |
366
| setCheckCharacterPortability((prop == null || Boolean.valueOf(prop)));
|
63 |
| } |
64 |
| } |
65 |
| |
66 |
1
| public boolean equals(Object obj)
|
67 |
| { |
68 |
1
| if (obj instanceof FileCacheLoaderConfig && equalsExcludingProperties(obj))
|
69 |
| { |
70 |
1
| return safeEquals(location, ((FileCacheLoaderConfig) obj).location);
|
71 |
| } |
72 |
0
| return false;
|
73 |
| } |
74 |
| |
75 |
366
| public int hashCode()
|
76 |
| { |
77 |
366
| return 31 * hashCodeExcludingProperties() + (location == null ? 0 : location.hashCode());
|
78 |
| } |
79 |
| |
80 |
| } |