public Class<?> loadClass(String className) throws Exception {
  LoadedClass loadedClass=null;
synchronized (loadedClasses) {
    loadedClass=loadedClasses.get(className);
  }
  if (loadedClass == null) {
    String resource=className.replace('.','/') + ".java";
    SourceDir src=locateResource(resource);
    if (src == null) {
      throw new ClassNotFoundException("DynaCode class not found " + className);
    }
synchronized (this) {
      loadedClass=new LoadedClass(className,src);
synchronized (loadedClasses) {
        loadedClasses.put(className,loadedClass);
      }
    }
    return loadedClass.clazz;
  }
  if (loadedClass.isChanged()) {
    unload(loadedClass.srcDir);
    return loadClass(className);
  }
  return loadedClass.clazz;
}

public Class < ? > loadClass ( String className ) throws Exception { LoadedClass loadedClass = null ; synchronized ( loadedClasses ) { loadedClass = loadedClasses . get ( className ) ; } if ( loadedClass == null ) { String resource = className . replace ( '.' , '/' ) + ".java" ; SourceDir src = locateResource ( resource ) ; if ( src == null ) { throw new ClassNotFoundException ( "DynaCode class not found " + className ) ; } synchronized ( this ) { loadedClass = new LoadedClass ( className , src ) ; synchronized ( loadedClasses ) { loadedClasses . put ( className , loadedClass ) ; } } return loadedClass . clazz ; } if ( loadedClass . isChanged ( ) ) { unload ( loadedClass . srcDir ) ; return loadClass ( className ) ; } return loadedClass . clazz ; }
returns the up - to - date dynamic class by name .
