01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.object.config;
06:
07: public final class DSOChangeApplicatorSpec implements
08: ChangeApplicatorSpec {
09: private final String changeApplicatorClassName;
10: private final ClassLoader classLoader;
11:
12: public DSOChangeApplicatorSpec(String changeApplicatorClassName) {
13: this .changeApplicatorClassName = changeApplicatorClassName;
14: classLoader = null;
15: }
16:
17: public DSOChangeApplicatorSpec(String changeApplicatorClassName,
18: ClassLoader classLoader) {
19: this .changeApplicatorClassName = changeApplicatorClassName;
20: this .classLoader = classLoader;
21: }
22:
23: public final Class getChangeApplicator(Class clazz) {
24: try {
25: if (classLoader == null) {
26: return Class.forName(changeApplicatorClassName);
27: } else {
28: return Class.forName(changeApplicatorClassName, false,
29: classLoader);
30: }
31: } catch (Exception e) {
32: throw new AssertionError(e);
33: }
34: }
35:
36: }
|