@Override
    protected Class<?> loadClass(final String name, boolean resolve) throws ClassNotFoundException {
        Class<?> clazz = null;

        synchronized (this) {
            clazz = findLoadedClass(name);
        }

        if (clazz == null) {
            clazz = withClassLoaders(new AbstractClassLoaderClosure<Class<?>>() {
                public boolean execute(UnmodifiableURLClassLoader classLoader) {
                    try {
                        value = classLoader.loadClass(name);
                    } catch (ClassNotFoundException cnfe) {
                        // continue
                    }

                    return value != null;
                }

                public void onCompletion() throws ClassNotFoundException {
                    if (value == null) {
                        throw new ClassNotFoundException(name + " not found by " + this);
                    }
                }
            });
        }

        if (resolve) {
            resolveClass(clazz);
        }
        return clazz;
    }