1 package org.jboss.cache.loader; 2 3 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig; 4 5 import java.util.Properties ; 6 7 public class RmiDelegatingCacheLoaderConfig extends IndividualCacheLoaderConfig 8 { 9 12 private static final long serialVersionUID = 4578924632178739084L; 13 14 private String host = "localhost"; 15 private String port = "1098"; 16 private String bindName; 17 18 public RmiDelegatingCacheLoaderConfig() 19 { 20 setClassName(RmiDelegatingCacheLoader.class.getName()); 21 } 22 23 28 RmiDelegatingCacheLoaderConfig(IndividualCacheLoaderConfig base) 29 { 30 setClassName(RmiDelegatingCacheLoader.class.getName()); 31 populateFromBaseConfig(base); 32 } 33 34 public String getBindName() 35 { 36 return bindName; 37 } 38 39 public void setBindName(String bindName) 40 { 41 testImmutability("bindName"); 42 this.bindName = bindName; 43 } 44 45 public String getHost() 46 { 47 return host; 48 } 49 50 public void setHost(String host) 51 { 52 testImmutability("host"); 53 this.host = host; 54 } 55 56 public String getPort() 57 { 58 return port; 59 } 60 61 public void setPort(String port) 62 { 63 testImmutability("port"); 64 this.port = port; 65 } 66 67 public void setProperties(Properties props) 68 { 69 super.setProperties(props); 70 String s = props.getProperty("host"); 71 if (s != null && s.length() > 0) 72 { 73 this.host = s; 74 } 75 s = props.getProperty("port"); 76 if (s != null && s.length() > 00) 77 { 78 this.port = s; 79 } 80 this.bindName = props.getProperty("bindName"); 81 } 82 83 public boolean equals(Object obj) 84 { 85 if (obj instanceof RmiDelegatingCacheLoaderConfig && equalsExcludingProperties(obj)) 86 { 87 RmiDelegatingCacheLoaderConfig other = (RmiDelegatingCacheLoaderConfig) obj; 88 89 return safeEquals(host, other.host) 90 && safeEquals(port, other.port) 91 && safeEquals(bindName, other.bindName); 92 } 93 return false; 94 } 95 96 public int hashCode() 97 { 98 int result = hashCodeExcludingProperties(); 99 result = 31 * result + (host == null ? 0 : host.hashCode()); 100 result = 31 * result + (port == null ? 0 : port.hashCode()); 101 result = 31 * result + (bindName == null ? 0 : bindName.hashCode()); 102 103 return result; 104 } 105 106 107 } | Popular Tags |