|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ClassLoader
com.valhalla.pluginmanager.PluginLoader
public class PluginLoader
This class supports the loading of custom plugins from jar files. The main
class in the Jar should be named after the jar filename and should be in the
"package" String passed to the PluginLoader package. For example, the plugin
LookAndFeel would be in a jar file called LookAndFeel.jar, and if the package
parameter was com.valhalla.jbother.plugins there would need to be a class
called com.valhalla.jbother.plugins.LookAndFeel in the jar
file
| Method Summary | |
|---|---|
java.lang.String |
findLibrary(java.lang.String lib)
Finds which plugin contains the specified native library, extracts it to a temporary location, and returns the path to that location or null if the native library could not be found. |
void |
findPlugins(java.lang.String d)
Reads in all the available plugins and the information about them |
static int |
getAPIVersion()
Gets the current plugin API version |
java.util.ArrayList |
getAvailablePlugins()
|
java.util.ArrayList |
getIncompatiblePlugins()
|
java.util.ArrayList |
getInstalledPlugins()
|
static PluginLoader |
getInstance()
Gets the singleton of this class |
java.util.ArrayList |
getInvalidPlugins()
|
protected java.util.Hashtable |
getLoadedClasses()
|
java.util.Hashtable |
getLoadedPlugins()
|
static PluginLoader |
getNewInstance()
|
PluginJAR |
getPlugin(java.lang.String name)
Returns the jar file for the specified plugin name |
java.io.InputStream |
getResourceAsStream(java.lang.String resource)
Gets a resource as a stream |
java.lang.Class |
loadClass(java.lang.String className,
boolean resolveIt)
Loads the Class out of the plugin file |
void |
loadPlugins()
Attempts to load the available plugins |
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, 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 |
| Method Detail |
|---|
public static PluginLoader getInstance()
public static PluginLoader getNewInstance()
public java.lang.String findLibrary(java.lang.String lib)
findLibrary in class java.lang.ClassLoaderthe - name of the library
public java.util.Hashtable getLoadedPlugins()
public java.util.ArrayList getAvailablePlugins()
public java.util.ArrayList getInstalledPlugins()
public java.util.ArrayList getInvalidPlugins()
public java.util.ArrayList getIncompatiblePlugins()
public PluginJAR getPlugin(java.lang.String name)
name - the plugin name
public static int getAPIVersion()
public void loadPlugins()
public void findPlugins(java.lang.String d)
public java.io.InputStream getResourceAsStream(java.lang.String resource)
getResourceAsStream in class java.lang.ClassLoaderresource - the resource to get
protected java.util.Hashtable getLoadedClasses()
public java.lang.Class loadClass(java.lang.String className,
boolean resolveIt)
throws java.lang.ClassNotFoundException
loadClass in class java.lang.ClassLoaderclassName - the class name to loadresolveIt - true to resolve the class (load dependancies)
ClassNotFoundException - if the class could not be
found in the system or any of the plugin files
java.lang.ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||