net.groboclown.util.classes.v1.jdk0
Class ArrayClassLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--net.groboclown.util.classes.v1.jdk0.ArrayClassLoader

public class ArrayClassLoader
extends ClassLoader

Load classes by byte Arrays. JDK 1.0+ compatible.

Version:
Alpha 1.0
Author:
Matt Albrecht

Inner classes inherited from class java.lang.ClassLoader
ClassLoader.NativeLibrary
 
Field Summary
private  BytecodeSource m_bytecodeSource
          The original bytecode source, for linking.
private  Hashtable m_classCache
           
private  Hashtable m_classList
          list of all classes
 
Fields inherited from class java.lang.ClassLoader
bootstrapClassPath, classes, defaultDomain, defaultPermissions, domains, getClassLoaderPerm, initialized, loadedLibraryNames, nativeLibraries, nativeLibraryContext, nocerts, package2certs, packages, parent, scl, sclSet, sys_paths, systemNativeLibraries, usr_paths
 
Constructor Summary
ArrayClassLoader()
          Default constructor
 
Method Summary
 void addClass(String name, byte[] bytecode)
          Add a new class to the internal list.
protected  byte[] getBytecode(String className)
          Retrieves the internal bytecode for the given class.
 Class loadClass(String name, boolean resolve)
           
 void setBytecodeSource(BytecodeSource bs)
          Sets the reference to the original bytecode loader.
 
Methods inherited from class java.lang.ClassLoader
, addClass, check, checkCerts, checkPackageAccess, compareCerts, defineClass, defineClass, defineClass, defineClass0, definePackage, findBootstrapClass, findBootstrapClass0, findClass, findLibrary, findLoadedClass, findNative, findResource, findResources, findSystemClass, getBootstrapClassPath, getBootstrapResource, getBootstrapResources, getCallerClassLoader, getDefaultDomain, getGetClassLoaderPerm, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, initializePath, isAncestor, loadClass, loadClassInternal, loadLibrary, loadLibrary0, resolveClass, resolveClass0, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_classList

private Hashtable m_classList
list of all classes

m_classCache

private Hashtable m_classCache

m_bytecodeSource

private BytecodeSource m_bytecodeSource
The original bytecode source, for linking.
Constructor Detail

ArrayClassLoader

public ArrayClassLoader()
Default constructor
Method Detail

setBytecodeSource

public void setBytecodeSource(BytecodeSource bs)
Sets the reference to the original bytecode loader. By default, the value is null. If the value is null, then there is the possibility for a link error.

addClass

public void addClass(String name,
                     byte[] bytecode)
Add a new class to the internal list.

loadClass

public Class loadClass(String name,
                       boolean resolve)
                throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader

getBytecode

protected byte[] getBytecode(String className)
Retrieves the internal bytecode for the given class. If not known, then will attempt to pass it to the bytecode source.
Parameters:
className - a non-null class name.


Written under the LGPL