1 5 package com.tc.object.config; 6 7 public final class DSOChangeApplicatorSpec implements ChangeApplicatorSpec { 8 private final String changeApplicatorClassName; 9 private final ClassLoader classLoader; 10 11 public DSOChangeApplicatorSpec(String changeApplicatorClassName) { 12 this.changeApplicatorClassName = changeApplicatorClassName; 13 classLoader = null; 14 } 15 16 public DSOChangeApplicatorSpec(String changeApplicatorClassName, ClassLoader classLoader) { 17 this.changeApplicatorClassName = changeApplicatorClassName; 18 this.classLoader = classLoader; 19 } 20 21 public final Class getChangeApplicator(Class clazz) { 22 try { 23 if (classLoader == null) { 24 return Class.forName(changeApplicatorClassName); 25 } else { 26 return Class.forName(changeApplicatorClassName, false, classLoader); 27 } 28 } catch (Exception e) { 29 throw new AssertionError (e); 30 } 31 } 32 33 } 34 | Popular Tags |