class ConfigurableClassLoader extends URLClassLoader {

    @Override
    public Class<?> loadClass(final String name, final boolean resolve) throws ClassNotFoundException {
        if (name == null) { // some frameworks (hibernate to not cite it) do it
            throw new ClassNotFoundException();
        }

        final Class<?> aClass = proxies.get(name);
        if (aClass != null) {
            return aClass;
        }

        synchronized (getClassLoadingLock(name)) {
            Class<?> clazz;

            // if in the JVM, never override them
            if (isDirectJvmClass(name)) {
                clazz = loadFromJvm(name, resolve);
                if (clazz != null) {
                    return clazz;
                }
            }

            // already loaded?
            clazz = findLoadedClass(name);
            if (postLoad(resolve, clazz)) {
                return clazz;
            }

            // look for it in this classloader
            final boolean childFirst = childFirstFilter.test(name);
            if (childFirst) {
                clazz = loadInternal(name, resolve);
                if (clazz != null) {
                    return clazz;
                }
            }

            // if parent first or not present in this loader, try the parent chain
            if (parentFilter.test(name)) {
                clazz = loadFromParent(name, resolve);
                if (clazz != null) {
                    return clazz;
                }
            }

            // if this class was a parent first then try to load it now parent loading
            // failed
            if (!childFirst) {
                clazz = loadInternal(name, resolve);
                if (clazz != null) {
                    return clazz;
                }
            }

            if (shouldFallbackOnJvmLoading(name)) {
                clazz = loadFromJvm(name, resolve);
                if (clazz != null) {
                    return clazz;
                }
            }

            // last chance using java defined classpath
            clazz = classLoaderFromClasspath.loadClass(name);
            if (clazz != null) {
                return clazz;
            }

            throw new ClassNotFoundException(name);
        }
    }

    public  ConfigurableClassLoader(final String id, final URL[] urls, final ClassLoader parent,
            final Predicate<String> parentFilter, final Predicate<String> childFirstFilter,
            final String[] nestedDependencies, final String[] jvmPrefixes);
    private  ConfigurableClassLoader(final String id, final URL[] urls, final ClassLoader parent,
            final Predicate<String> parentFilter, final Predicate<String> childFirstFilter,
            final Map<String, Collection<Resource>> resources, final String[] jvmPrefixes);

}