If the class is within the ClassCache instances namespace, the ClassCache object now computes the hash value of the class name and checks if the a DisposableClassLoader is associated with this hash value. If yes, the system checks if either this class loader or any class loader for a class referred have a class that was modified on disk since it was loaded. Otherwise if no DisposableClassLoader is associated with this hash, a new one is allocated. Once a DisposableClassLoader is found for a given hash, the ClassCache object now delegates the work of loading the class to the DisposableClassLoader. If not the loading is delegated back to the class cache.
Checks are in place to make sure that mutual recursion never takes place.
The actual algorithm to test whether a ClassLoader should be thrown out or not is based on references and building a class hierarchy in the ClassLoaders. For example, consider the following class hierarchy and the sample classcache in the first section. XXXX Let us assume that the entire hierarchy has been loaded. Note that X will not be loaded by the classCache because of the exclusion list. Suppose we now try to load XXX2.