@Override
  public synchronized Class<?> loadClass(final String className, final boolean resolveIt)
      throws ClassNotFoundException {

    Class<?> result;
    byte[] classBytes;
    monitor(">> MultiClassLoader.loadClass(" + className + ", " + resolveIt + ")");

    // ----- Check our local cache of classes
    result = classes.get(className);
    if (result != null) {
      monitor(">> returning cached result.");
      return result;
    }

    // ----- Check with the primordial class loader
    try {
      result = super.findSystemClass(className);
      monitor(">> returning system class (in CLASSPATH).");
      return result;
    } catch (final ClassNotFoundException e) {
      monitor(">> Not a system class.");
    }

    // ----- Try to load it from preferred source
    // Note loadClassBytes() is an abstract method
    classBytes = loadClassBytes(className);
    if (classBytes == null) {
      throw new ClassNotFoundException();
    }

    // ----- Define it (parse the class file)
    result = defineClass(className, classBytes, 0, classBytes.length);
    if (result == null) {
      throw new ClassFormatError();
    }

    // ----- Resolve if necessary
    if (resolveIt) {
      resolveClass(result);
    }

    // Done
    classes.put(className, result);
    monitor(">> Returning newly loaded class.");
    return result;
  }
This is a simple version for external clients since they will always want the class resolved
before it is returned to them.
java/zylib/src/main/java/com/google/security/zynamics/zylib/plugins/MultiClassLoader.java