01: package dalma.test;
02:
03: /**
04: * {@link ClassLoader} that masks <tt>test.*</tt> classes visible
05: * in the parent class loader.
06: *
07: * @author Kohsuke Kawaguchi
08: */
09: public class MaskingClassLoader extends ClassLoader {
10: public MaskingClassLoader(ClassLoader parent) {
11: super (parent);
12: }
13:
14: protected synchronized Class<?> loadClass(String name,
15: boolean resolve) throws ClassNotFoundException {
16: if (name.startsWith("test."))
17: throw new ClassNotFoundException(name + " is masked");
18: return super.loadClass(name, resolve);
19: }
20: }
|