1 4 package com.tc.object.dna.impl; 5 6 import com.tc.object.loaders.ClassProvider; 7 8 import java.io.Serializable ; 9 10 public class ClassLoaderInstance implements Serializable { 11 12 private final UTF8ByteDataHolder loaderDef; 13 14 public ClassLoaderInstance(UTF8ByteDataHolder loaderDefinition) { 15 loaderDef = loaderDefinition; 16 } 17 18 public boolean equals(Object obj) { 19 if (obj instanceof ClassLoaderInstance) { 20 ClassLoaderInstance other = (ClassLoaderInstance) obj; 21 return this.loaderDef.equals(other.loaderDef); 22 } 23 return false; 24 } 25 26 public ClassLoader asClassLoader(ClassProvider classProvider) { 27 String classLoaderdef = loaderDef.asString(); 28 return classProvider.getClassLoader(classLoaderdef); 29 } 30 31 public int hashCode() { 32 int hash = 17; 33 hash = (37 * hash) + loaderDef.hashCode(); 34 return hash; 35 } 36 37 public UTF8ByteDataHolder getLoaderDef() { 38 return loaderDef; 39 } 40 } 41 | Popular Tags |