1 25 26 package org.objectweb.easybeans.util.loader; 27 28 32 public final class ClassUtils { 33 34 37 private ClassUtils() {} 38 39 45 public static Class forName(final String className) throws ClassNotFoundException { 46 50 ClassLoader tccl = Thread.currentThread().getContextClassLoader(); 51 Class cls = null; 52 53 try { 54 cls = Class.forName(className, true, tccl); 56 } catch (ClassNotFoundException cnfe) { 57 58 ClassLoader current = ClassUtils.class.getClassLoader(); 60 try { 61 cls = Class.forName(className, true, current); 62 } catch (ClassNotFoundException cnfe2) { 63 throw cnfe2; 65 } 66 } 67 68 return cls; 69 } 70 71 } 72 | Popular Tags |