nz.ac.waikato.mcennis.rat
Class DynamicLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by nz.ac.waikato.mcennis.rat.DynamicLoader

public class DynamicLoader
extends java.lang.ClassLoader

Dynamic Loader handles the initialization of all factory objects in Graph-RAT. All internal factories and classes need to be added manually to either the lists here or to their respective factory class. Classes or factories loaded by dynamic linking do not have this restriction and do not require a configuration file.


Field Summary
static boolean isInitialized
           
 
Method Summary
 void addFactoryType(AbstractFactory factory)
          Method called by Factory objects to register themselves with the DynamicLoader.
protected  void findClass(java.lang.String prefix, java.io.File currentDirectory, java.util.LinkedList<java.lang.String> names, java.util.LinkedList<java.io.File> files)
           
static void initialization()
          Initializes the DynamicLoader, initializing in turn all other internal factory objects.
protected  void loadClass(java.lang.String name, java.io.InputStream fileStream)
           
 void loadClasses()
          Attempts to find the directory determined by the GRAPH_RAT environment variable.
protected  void loadMaps(java.lang.Class name)
           
static DynamicLoader newInstance()
          Singleton creation method for this DynamicLoader.
 
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, 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

isInitialized

public static boolean isInitialized
Method Detail

newInstance

public static DynamicLoader newInstance()
Singleton creation method for this DynamicLoader. static callers should call initialization() before attempting to use this object.


initialization

public static void initialization()
Initializes the DynamicLoader, initializing in turn all other internal factory objects.


loadClasses

public void loadClasses()
Attempts to find the directory determined by the GRAPH_RAT environment variable. If this does not exist, it utilizes the current directory. All classes contained in the /lib directory are loaded and then all jar files located in the /jar directory are loaded. The loading process is two pass. In the first pass, all objects are registered with the JVM. In the second pass, all objects in these directories are automatically registered with the appropriate factory objects.


findClass

protected void findClass(java.lang.String prefix,
                         java.io.File currentDirectory,
                         java.util.LinkedList<java.lang.String> names,
                         java.util.LinkedList<java.io.File> files)

loadClass

protected void loadClass(java.lang.String name,
                         java.io.InputStream fileStream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

loadMaps

protected void loadMaps(java.lang.Class name)

addFactoryType

public void addFactoryType(AbstractFactory factory)
Method called by Factory objects to register themselves with the DynamicLoader. This is done automatically if the code specified in the AbstractFactory Javadoc is included in the factory source.

Parameters:
factory - factory object to be registered with the dynamic factory.

Get Relational Analysis Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads