Package ucar.unidata.util
Class PluginClassLoader
java.lang.Object
java.lang.ClassLoader
ucar.unidata.util.PluginClassLoader
Class PluginClassLoader. Loads plugin classes
- Version:
- $Revision: 1.54 $
- Author:
- IDV Development Team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkClass
(Class c) void
closeJar()
Close the jar fileprotected String
defineResource
(JarEntry jarEntry) Associate the resource name with the jar entrygetClassFromPlugin
(String name) Check if this class is one we loaded from a pluginGet the list of (String) names of the non-class files in the jargetResource
(String resource) Open the resource as a URLgetResourceAsStream
(String resource) Open the resource as a istream if we have itprotected void
handleError
(String msg, Throwable exc) Overwrite base class method to load in a class by nametoString()
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
PLUGIN_PROTOCOL
for url plugins- See Also:
-
-
Constructor Details
-
PluginClassLoader
ctor- Parameters:
jarFilePath
- Where the jar file isparent
- parent- Throws:
IOException
- On badness
-
-
Method Details
-
toString
-
handleError
-
closeJar
public void closeJar()Close the jar file -
getEntryNames
Get the list of (String) names of the non-class files in the jar- Returns:
- List of jar entries
-
checkClass
- Throws:
Exception
-
loadClass
Overwrite base class method to load in a class by name- Overrides:
loadClass
in classClassLoader
- Parameters:
name
- class name- Returns:
- The class
- Throws:
ClassNotFoundException
- On badness
-
getClassFromPlugin
Check if this class is one we loaded from a plugin- Returns:
- the class or null
-
defineResource
Associate the resource name with the jar entry- Parameters:
jarEntry
- THe entry
-
getResource
Open the resource as a URL- Overrides:
getResource
in classClassLoader
- Parameters:
resource
- The resource- Returns:
- The URL
-
getResourceAsStream
Open the resource as a istream if we have it- Overrides:
getResourceAsStream
in classClassLoader
- Parameters:
resource
- The resource- Returns:
- The istream
-