KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > core > util > ClassLoaderReference


1 package com.thoughtworks.xstream.core.util;
2
3 /**
4  * ClassLoader that refers to another ClassLoader, allowing a single instance to be passed around the codebase that
5  * can later have its destination changed.
6  *
7  * @author Joe Walnes
8  * @since 1.1.1
9  */

10 public class ClassLoaderReference extends ClassLoader JavaDoc {
11
12     private ClassLoader JavaDoc reference;
13
14     public ClassLoaderReference(ClassLoader JavaDoc reference) {
15         this.reference = reference;
16     }
17
18     public Class JavaDoc loadClass(String JavaDoc name) throws ClassNotFoundException JavaDoc {
19         return reference.loadClass(name);
20     }
21
22     public ClassLoader JavaDoc getReference() {
23         return reference;
24     }
25
26     public void setReference(ClassLoader JavaDoc reference) {
27         this.reference = reference;
28     }
29 }
30
Popular Tags