1 22 package org.jboss.services.binding; 23 24 31 public class ServiceConfig implements Cloneable 32 { 33 36 private String serviceName; 37 39 private String serviceConfigDelegateClassName; 40 43 private Object serviceConfigDelegateConfig; 44 46 private ServiceBinding[] bindings; 47 48 49 public ServiceConfig() 50 { 51 } 52 53 55 public Object clone() 56 { 57 ServiceConfig copy = new ServiceConfig(); 58 copy.serviceName = serviceName; 60 copy.serviceConfigDelegateClassName = serviceConfigDelegateClassName; 61 int length = bindings != null ? bindings.length : 0; 62 copy.bindings = new ServiceBinding[length]; 63 for(int b = 0; b < length; b ++) 64 { 65 copy.bindings[b] = (ServiceBinding) bindings[b].clone(); 66 } 67 return copy; 68 } 69 70 73 public String getServiceName() 74 { 75 return this.serviceName; 76 } 77 78 81 public void setServiceName(String serviceName) 82 { 83 this.serviceName = serviceName; 84 } 85 86 89 public ServiceBinding[] getBindings() 90 { 91 return this.bindings; 92 } 93 94 97 public void setBindings(ServiceBinding[] bindings) 98 { 99 this.bindings = bindings; 100 } 101 102 105 public String getServiceConfigDelegateClassName() 106 { 107 return serviceConfigDelegateClassName; 108 } 109 110 113 public void setServiceConfigDelegateClassName(String serviceConfigDelegateClassName) 114 { 115 this.serviceConfigDelegateClassName = serviceConfigDelegateClassName; 116 } 117 118 121 public Object getServiceConfigDelegateConfig() 122 { 123 return serviceConfigDelegateConfig; 124 } 125 126 129 public void setServiceConfigDelegateConfig(Object serviceConfigDelegateConfig) 130 { 131 this.serviceConfigDelegateConfig = serviceConfigDelegateConfig; 132 } 133 134 136 public boolean equals(Object obj) 137 { 138 boolean equals = false; 139 if( obj instanceof ServiceConfig ) 140 { 141 ServiceConfig sc = (ServiceConfig) obj; 142 equals = this.serviceName.equals(sc.serviceName); 143 } 144 else 145 { 146 equals = super.equals(obj); 147 } 148 return equals; 149 } 150 151 153 public int hashCode() 154 { 155 int hashCode = serviceName == null ? 0 : serviceName.hashCode(); 156 return hashCode; 157 } 158 159 public String toString() 160 { 161 StringBuffer buffer = new StringBuffer ("ServiceConfig(name="); 162 buffer.append(serviceName); 163 buffer.append("), bindings=<"); 164 int length = bindings != null ? bindings.length : 0; 165 for(int b = 0; b < length; b ++) 166 { 167 buffer.append(bindings[b].toString()); 168 } 169 buffer.append(">"); 170 return buffer.toString(); 171 } 172 173 } 174 | Popular Tags |