1 22 23 package org.objectweb.petals.tools.jbicommon.descriptor; 24 25 import java.util.List ; 26 27 import org.apache.commons.lang.builder.EqualsBuilder; 28 import org.apache.commons.lang.builder.HashCodeBuilder; 29 import org.apache.commons.lang.builder.ToStringBuilder; 30 31 38 public class ComponentDescription extends ExtensibleJbiElement { 39 40 43 private static final String BC_TYPE = "binding-component"; 44 45 48 private static final String SE_TYPE = "service-engine"; 49 50 54 private String bootstrapClassLoaderDelegation; 55 56 60 private String bootstrapClassName; 61 62 65 private List <String > bootstrapClassPath; 66 67 71 private String componentClassLoaderDelegation; 72 73 77 private String componentClassName; 78 79 82 private List <String > componentClassPath; 83 84 87 private Identification identification; 88 89 92 private List <SharedLibraryList> sharedLibraryList; 93 94 97 private String type; 98 99 102 public ComponentDescription() { super(); 104 } 105 106 @Override 107 public boolean equals(final Object other) { 108 if (!(other instanceof ComponentDescription)) { 109 return false; } 111 ComponentDescription castOther = (ComponentDescription) other; 112 return new EqualsBuilder().append(bootstrapClassLoaderDelegation, 113 castOther.bootstrapClassLoaderDelegation).append( 114 bootstrapClassName, castOther.bootstrapClassName).append( 115 bootstrapClassPath, castOther.bootstrapClassPath).append( 116 componentClassLoaderDelegation, 117 castOther.componentClassLoaderDelegation).append( 118 componentClassName, castOther.componentClassName).append( 119 componentClassPath, castOther.componentClassPath).append( 120 identification, castOther.identification).append( 121 sharedLibraryList, castOther.sharedLibraryList).append(type, 122 castOther.type).isEquals(); 123 } 124 125 133 public String getBootstrapClassLoaderDelegation() { 134 return bootstrapClassLoaderDelegation; 135 } 136 137 144 public String getBootstrapClassName() { 145 return bootstrapClassName; 146 } 147 148 152 158 public List <String > getBootstrapClassPath() { 159 return bootstrapClassPath; 160 } 161 162 170 public String getComponentClassLoaderDelegation() { 171 return componentClassLoaderDelegation; 172 } 173 174 181 public String getComponentClassName() { 182 return componentClassName; 183 } 184 185 193 public List <String > getComponentClassPath() { 194 return componentClassPath; 195 } 196 197 202 public Identification getIdentification() { 203 return identification; 204 } 205 206 214 public List <SharedLibraryList> getSharedLibraryList() { 215 return sharedLibraryList; 216 } 217 218 224 public String getType() { 225 return type; 226 } 227 228 @Override 229 public int hashCode() { 230 return new HashCodeBuilder().append(bootstrapClassLoaderDelegation) 231 .append(bootstrapClassName).append(bootstrapClassPath).append( 232 componentClassLoaderDelegation).append( 233 componentClassName).append(componentClassPath).append( 234 identification).append(sharedLibraryList).append(type) 235 .toHashCode(); 236 } 237 238 242 public boolean isBindingComponent() { 243 return BC_TYPE.equals(type); 244 } 245 246 250 public boolean isServiceEngine() { 251 return SE_TYPE.equals(type); 252 } 253 254 @Override 255 public String toString() { 256 return new ToStringBuilder(this).append( 257 "bootstrapClassLoaderDelegation", 258 bootstrapClassLoaderDelegation).append("bootstrapClassName", 259 bootstrapClassName).append("bootstrapClassPath", 260 bootstrapClassPath).append("componentClassLoaderDelegation", 261 componentClassLoaderDelegation).append("componentClassName", 262 componentClassName).append("componentClassPath", 263 componentClassPath).append("identification", identification) 264 .append("sharedLibraryList", sharedLibraryList).append("type", 265 type).toString(); 266 } 267 268 275 protected void setBootstrapClassLoaderDelegation( 276 final String delegationModel) { 277 this.bootstrapClassLoaderDelegation = delegationModel; 278 } 279 280 287 protected void setBootstrapClassName(final String className) { 288 this.bootstrapClassName = className; 289 } 290 291 298 protected void setBootstrapClassPath(final List <String > classPath) { 299 this.bootstrapClassPath = classPath; 300 } 301 302 309 protected void setComponentClassLoaderDelegation( 310 final String delegationModel) { 311 this.componentClassLoaderDelegation = delegationModel; 312 } 313 314 320 protected void setComponentClassName(final String className) { 321 this.componentClassName = className; 322 } 323 324 331 protected void setComponentClassPath(final List <String > classPath) { 332 this.componentClassPath = classPath; 333 } 334 335 341 protected void setIdentification(final Identification identification) { 342 this.identification = identification; 343 } 344 345 349 356 protected void setSharedLibraryList( 357 final List <SharedLibraryList> sharedLibraryList) { 358 359 this.sharedLibraryList = sharedLibraryList; 360 } 361 362 369 protected void setType(final String type) { 370 this.type = type; 371 } 372 } 373 | Popular Tags |