|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.ClassLoader | +--java.security.SecureClassLoader | +--java.net.URLClassLoader | +--net.java.games.util.plugins.PluginLoader
This class is used internally by the Plugin system. End users of the system are unlikely to need to be aware of it. This is the class loader used to keep the namespaces of different plugins isolated from each other and from the main app code. One plugin loader is created per Jar file in the sub-directory tree of the plugin directory. In addition to isolating java classes this loader also isolates DLLs such that plugins with conflicting DLL names may be used by simply placing the plugin and its associated DLL in a sub-folder of its own. This class also currently implements methods for testing classes for inheritance of superclasses or interfaces. This code is genericly useful and should really be moved to a seperate ClassUtils class.
Constructor Summary | |
PluginLoader(java.io.File jf)
Creates a new instance of PluginLodaer If the system property "net.java.games.util.plugins.nolocalnative" is not set then the laoder will look for requried native libs in the same directory as the plugin jar. |
Method Summary | |
boolean |
attemptPluginDefine(java.lang.Class pc)
This function is called as part of scanning the Jar for plugins. |
protected java.lang.String |
findLibrary(java.lang.String libname)
This method is queried by the System.loadLibrary() code to find the actual native name and path to the native library to load. |
Methods inherited from class java.net.URLClassLoader |
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
defineClass |
Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLoadedClass, 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(java.io.File jf) throws java.net.MalformedURLException
jf
- The JarFile to load the Plugins from.
java.net.MalformedURLException
- Will throw this exception if jf does not refer to a
legitimate Jar file.Method Detail |
protected java.lang.String findLibrary(java.lang.String libname)
findLibrary
in class java.lang.ClassLoader
libname
- The JNI name of the native library to locate.
public boolean attemptPluginDefine(java.lang.Class pc)
pc
- The potential plug-in class to vette.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |