com.go.trove.util
Class DelegateClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--com.go.trove.util.DelegateClassLoader

public class DelegateClassLoader
extends java.lang.ClassLoader

ClassLoader that delegates class loading requests if the parent ClassLoader (and its ancestors) can't fulfill the request. Class loading requests are handed off to scouts, which are called upon in sequence to find the class, until the class is found. If neither the parent or scouts can find a requested class, a normal ClassNotFoundException is thrown.

Version:
14 , 7/27/01
Author:
Brian S O'Neill

Constructor Summary
DelegateClassLoader(java.lang.ClassLoader[] scouts)
          Deprecated. Actual parent ClassLoader must always be provided to prevent unexpected behavior.
DelegateClassLoader(java.lang.ClassLoader parent, java.lang.ClassLoader[] scouts)
           
 
Method Summary
protected  java.lang.Class findClass(java.lang.String name)
           
protected  java.net.URL findResource(java.lang.String name)
           
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegateClassLoader

public DelegateClassLoader(java.lang.ClassLoader parent,
                           java.lang.ClassLoader[] scouts)
Parameters:
parent - ClassLoader that gets first chance to load a class
scouts - ClassLoaders that get next chances to load a class, if the parent couldn't find it.

DelegateClassLoader

public DelegateClassLoader(java.lang.ClassLoader[] scouts)
Deprecated. Actual parent ClassLoader must always be provided to prevent unexpected behavior.

Parameters:
scouts - ClassLoaders that get next chances to load a class, if the parent couldn't find it.
Method Detail

findClass

protected java.lang.Class findClass(java.lang.String name)
                             throws java.lang.ClassNotFoundException
Overrides:
findClass in class java.lang.ClassLoader

findResource

protected java.net.URL findResource(java.lang.String name)
Overrides:
findResource in class java.lang.ClassLoader