KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > loader > RpcDelegatingCacheLoaderConfig


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 JavaDoc;
7
8 public class RpcDelegatingCacheLoaderConfig extends IndividualCacheLoaderConfig
9 {
10    /**
11     * The serialVersionUID
12     */

13    private static final long serialVersionUID = -3425487656984237468L;
14
15    @Dynamic
16    private int timeout = 5000;
17
18    public RpcDelegatingCacheLoaderConfig()
19    {
20       setClassName(RpcDelegatingCacheLoader.class.getName());
21    }
22
23    /**
24     * For use by {@link RpcDelegatingCacheLoader}.
25     *
26     * @param base generic config object created by XML parsing.
27     */

28    RpcDelegatingCacheLoaderConfig(IndividualCacheLoaderConfig base)
29    {
30       setClassName(RpcDelegatingCacheLoader.class.getName());
31       populateFromBaseConfig(base);
32    }
33
34    public int getTimeout()
35    {
36       return timeout;
37    }
38
39    public void setTimeout(int timeout)
40    {
41       testImmutability("timeout");
42       this.timeout = timeout;
43    }
44
45    public void setProperties(Properties JavaDoc props)
46    {
47       if (props == null) return;
48
49       super.setProperties(props);
50       String JavaDoc t = props.getProperty("timeout");
51       if (t != null && t.length() > 0)
52       {
53          this.timeout = Integer.parseInt(t);
54       }
55    }
56
57    public boolean equals(Object JavaDoc obj)
58    {
59       if (obj instanceof RpcDelegatingCacheLoaderConfig && equalsExcludingProperties(obj))
60       {
61          RpcDelegatingCacheLoaderConfig other = (RpcDelegatingCacheLoaderConfig) obj;
62          return (this.timeout == other.timeout);
63       }
64       return false;
65    }
66
67    public int hashCode()
68    {
69       return 31 * hashCodeExcludingProperties() + timeout;
70    }
71
72 }
Popular Tags