atg.nucleus
Class JavaConfigurationClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by atg.nucleus.JavaConfigurationClassLoader

public class JavaConfigurationClassLoader
extends java.lang.ClassLoader

This implementation of ClassLoader is tied to a particular directory and is meant load classes that do not specify a package.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
JavaConfigurationClassLoader(VirtualFile pClassDir)
          Constructs a new JavaConfigurationClassLoader
 
Method Summary
 long getClassModificationTime(java.lang.String pName)
          If the specified class was loaded by this ClassLoader, this returns the last modified time of the class file at the time the class was loaded.
 boolean isClassLoaded(java.lang.String pName)
          Returns true if the specified class has already been loaded from the directory, false if not.
protected  java.lang.Class loadClass(java.lang.String pName, boolean pResolve)
          Loads the class by first checking the cache, then if the object doesn't have a package, this checks the directory, then passes the call to the embedded loader.
static byte[] readFileBytes(VirtualFile pFile)
          Reads the contents of the specified file into a byte array.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

JavaConfigurationClassLoader

public JavaConfigurationClassLoader(VirtualFile pClassDir)
Constructs a new JavaConfigurationClassLoader

Method Detail

isClassLoaded

public boolean isClassLoaded(java.lang.String pName)
Returns true if the specified class has already been loaded from the directory, false if not.


getClassModificationTime

public long getClassModificationTime(java.lang.String pName)
If the specified class was loaded by this ClassLoader, this returns the last modified time of the class file at the time the class was loaded. Returns -1 if the class was not loaded.


loadClass

protected java.lang.Class loadClass(java.lang.String pName,
                                    boolean pResolve)
                             throws java.lang.ClassNotFoundException
Loads the class by first checking the cache, then if the object doesn't have a package, this checks the directory, then passes the call to the embedded loader.

Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException - if named class was not found

readFileBytes

public static byte[] readFileBytes(VirtualFile pFile)
                            throws java.io.IOException
Reads the contents of the specified file into a byte array.

Parameters:
pFile - the input file
Returns:
the array of bytes contained in the file.
Throws:
java.io.IOException - if an error occurred opening or reading the file.