kiwi.util
Class ReplacementClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--kiwi.util.ReplacementClassLoader

public class ReplacementClassLoader
extends ClassLoader

A custom class loader that can be used to selectively replace core classes.

Version:
1.0 (05/98)
Author:
Mark Lindner, PING Software Grou

Field Summary
static String codebase
          The path (relative to the anchor) relative to which classes will be loaded.
 
Constructor Summary
ReplacementClassLoader(String[] replacementList, Class clazz)
          Construct a new ReplacementClassLoader.
 
Method Summary
protected  Class loadClass(String name, boolean resolve)
          Load a class.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codebase

public static final String codebase
The path (relative to the anchor) relative to which classes will be loaded.
Constructor Detail

ReplacementClassLoader

public ReplacementClassLoader(String[] replacementList,
                              Class clazz)
Construct a new ReplacementClassLoader. The class loader will become active once a class is loaded explicitly via its loadClass() method. All classes loaded by that class will, in turn, be loaded by this class loader.
Parameters:
replacementList - A list of full-qualified names of classes that will be loaded from a local source.
clazz - The class relative to which the patches resource directory is located. This resource directory contains the class hierarchy of replacement classes.
Method Detail

loadClass

protected Class loadClass(String name,
                          boolean resolve)
                   throws ClassNotFoundException
Load a class.
Parameters:
name - The fully-qualified name of the class to load.
resolve - A flag specifying whether the class should be resolved.
Throws:
ClassNotFoundException - If the named class could not be found.
Overrides:
loadClass in class ClassLoader