|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader edu.ucla.loni.LOVE.PluginLoader
public class PluginLoader
This class will look at .class files under plugins folder and retrieve these classes for use as plugins.
It provides centralized service for plugin loading. All the plugin classes that are loaded before will be stored in cache for later usages. The reason to extendClassLoader
is that we can use
those native, protected method of it. Those method can provide many
powerful functionality.
BUG/TO DO: Still don't know how to deal with Jarred class file.
if classes are jarred, the program can no longer list
all the files in the directory thus can't load classes.
Constructor Summary | |
---|---|
PluginLoader()
|
Method Summary | |
---|---|
static java.lang.Class |
loadAClass(java.lang.String className)
Load a single class as specified by the parameter. |
static java.util.Hashtable |
loadDirectory(java.lang.String packDir)
Load the classes in a directory .plugins.* Example of usage: loadDirectory("edu.ucla.loni.LOVE.plugin.colormap"); |
static void |
main(java.lang.String[] args)
Test program |
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 |
Constructor Detail |
---|
public PluginLoader()
Method Detail |
---|
public static java.util.Hashtable loadDirectory(java.lang.String packDir)
packDir
- The directory to be loadedpublic static java.lang.Class loadAClass(java.lang.String className)
className
- Name of the class, including package name.public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |