@Test public void checkDelegateProxyClassLoader() throws ClassNotFoundException { JarClassLoader classLoader = new JarClassLoader(); doIsolated(classLoader); assertTrue(classLoader.getLocalLoader().isEnabled()); try { classLoader.loadClass(Test1.class.getName()); fail("Should obtain java.lang.ClassNotFoundException: org.xeustechnologies.jcl.sample.Test1"); } catch (ClassNotFoundException e) { } JarClassLoader target = new JarClassLoader(); doIsolated(classLoader); assertTrue(classLoader.getLocalLoader().isEnabled()); target.add(Test1.class.getName()); target.loadClass(Test1.class.getName()); classLoader.addLoader(new DelegateProxyClassLoader(target)); classLoader.loadClass(Test1.class.getName()); }
@SuppressWarnings("rawtypes") public Class loadClass(String className, boolean resolveIt) { Class result; try { result = delegate.loadClass(className, resolveIt); } catch (ClassNotFoundException e) { return null; } return result; }
DelegateProxyClassLoader extends ProxyClassLoader { @SuppressWarnings("rawtypes") public Class loadClass(String className, boolean resolveIt) { Class result; try { result = delegate.loadClass(className, resolveIt); } catch (ClassNotFoundException e) { return null; } return result; } }
DelegateProxyClassLoader extends ProxyClassLoader { @SuppressWarnings("rawtypes") public Class loadClass(String className, boolean resolveIt) { Class result; try { result = delegate.loadClass(className, resolveIt); } catch (ClassNotFoundException e) { return null; } return result; } DelegateProxyClassLoader(AbstractClassLoader delegate); }
DelegateProxyClassLoader extends ProxyClassLoader { @SuppressWarnings("rawtypes") public Class loadClass(String className, boolean resolveIt) { Class result; try { result = delegate.loadClass(className, resolveIt); } catch (ClassNotFoundException e) { return null; } return result; } DelegateProxyClassLoader(AbstractClassLoader delegate); @SuppressWarnings("rawtypes") Class loadClass(String className, boolean resolveIt); InputStream loadResource(String name); @Override URL findResource(String name); AbstractClassLoader getDelegate(); }
DelegateProxyClassLoader extends ProxyClassLoader { @SuppressWarnings("rawtypes") public Class loadClass(String className, boolean resolveIt) { Class result; try { result = delegate.loadClass(className, resolveIt); } catch (ClassNotFoundException e) { return null; } return result; } DelegateProxyClassLoader(AbstractClassLoader delegate); @SuppressWarnings("rawtypes") Class loadClass(String className, boolean resolveIt); InputStream loadResource(String name); @Override URL findResource(String name); AbstractClassLoader getDelegate();  }