01: package dalma.container;
02:
03: import org.apache.bcel.util.Repository;
04: import org.apache.bcel.util.ClassPath;
05: import org.apache.bcel.classfile.JavaClass;
06:
07: /**
08: * {@link Repository} that delegates to another.
09: * @author Kohsuke Kawaguchi
10: */
11: public class DelegatingRepository implements Repository {
12: private Repository r;
13:
14: public void setRepository(Repository r) {
15: this .r = r;
16: }
17:
18: public void storeClass(JavaClass clazz) {
19: r.storeClass(clazz);
20: }
21:
22: public void removeClass(JavaClass clazz) {
23: r.removeClass(clazz);
24: }
25:
26: public JavaClass findClass(String className) {
27: return r.findClass(className);
28: }
29:
30: public JavaClass loadClass(String className)
31: throws ClassNotFoundException {
32: return r.loadClass(className);
33: }
34:
35: public JavaClass loadClass(Class clazz)
36: throws ClassNotFoundException {
37: return r.loadClass(clazz);
38: }
39:
40: public void clear() {
41: r.clear();
42: }
43:
44: public ClassPath getClassPath() {
45: return r.getClassPath();
46: }
47: }
|