public class PluginClassLoader
extends java.lang.ClassLoader
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLUGIN_PROTOCOL
for url plugins
|
Constructor and Description |
---|
PluginClassLoader(java.lang.String jarFilePath,
java.lang.ClassLoader parent)
ctor
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkClass(java.lang.Class c) |
void |
closeJar()
Close the jar file
|
protected java.lang.String |
defineResource(java.util.jar.JarEntry jarEntry)
Associate the resource name with the jar entry
|
java.lang.Class |
getClassFromPlugin(java.lang.String name)
Check if this class is one we loaded from a plugin
|
java.util.List |
getEntryNames()
Get the list of (String) names of the non-class files in the jar
|
java.net.URL |
getResource(java.lang.String resource)
Open the resource as a URL
|
java.io.InputStream |
getResourceAsStream(java.lang.String resource)
Open the resource as a istream if we have it
|
protected void |
handleError(java.lang.String msg,
java.lang.Throwable exc) |
java.lang.Class |
loadClass(java.lang.String name)
Overwrite base class method to load in a class by name
|
java.lang.String |
toString() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public static final java.lang.String PLUGIN_PROTOCOL
public PluginClassLoader(java.lang.String jarFilePath, java.lang.ClassLoader parent) throws java.io.IOException
jarFilePath
- Where the jar file isparent
- parentjava.io.IOException
- On badnesspublic java.lang.String toString()
toString
in class java.lang.Object
protected void handleError(java.lang.String msg, java.lang.Throwable exc)
public void closeJar()
public java.util.List getEntryNames()
protected void checkClass(java.lang.Class c) throws java.lang.Exception
java.lang.Exception
public java.lang.Class loadClass(java.lang.String name) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
name
- class namejava.lang.ClassNotFoundException
- On badnesspublic java.lang.Class getClassFromPlugin(java.lang.String name)
protected java.lang.String defineResource(java.util.jar.JarEntry jarEntry)
jarEntry
- THe entrypublic java.net.URL getResource(java.lang.String resource)
getResource
in class java.lang.ClassLoader
resource
- The resourcepublic java.io.InputStream getResourceAsStream(java.lang.String resource)
getResourceAsStream
in class java.lang.ClassLoader
resource
- The resource