@Test public void shouldLoadIsolatedClass() throws Exception { Class<?> isolatedClass = classLoader.loadClass( AbstractProvider.class.getName() ); assertThat( isolatedClass, is( notNullValue() ) ); assertThat( isolatedClass.getName(), is( AbstractProvider.class.getName() ) ); assertThat( isolatedClass, is( not( (Class) AbstractProvider.class ) ) ); }
@Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class<?> c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } }
IsolatedClassLoader extends URLClassLoader { @Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class<?> c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } } }
IsolatedClassLoader extends URLClassLoader { @Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class<?> c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } } IsolatedClassLoader( ClassLoader parent, boolean childDelegation, String roleName ); }
IsolatedClassLoader extends URLClassLoader { @Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class<?> c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } } IsolatedClassLoader( ClassLoader parent, boolean childDelegation, String roleName ); @Override @Deprecated void addURL( URL url ); @Override synchronized Class loadClass( String name ); @Override String toString(); }
IsolatedClassLoader extends URLClassLoader { @Override public synchronized Class loadClass( String name ) throws ClassNotFoundException { if ( childDelegation ) { Class<?> c = findLoadedClass( name ); if ( c == null ) { try { c = findClass( name ); } catch ( ClassNotFoundException e ) { if ( parent == null ) { throw e; } else { c = parent.loadClass( name ); } } } return c; } else { return super.loadClass( name ); } } IsolatedClassLoader( ClassLoader parent, boolean childDelegation, String roleName ); @Override @Deprecated void addURL( URL url ); @Override synchronized Class loadClass( String name ); @Override String toString();  }