org.rhq.core.pc.plugin
Class PluginClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.rhq.core.pc.plugin.PluginClassLoader
public class PluginClassLoader
- extends URLClassLoader
Classloader for the plugin jar itself and any embedded lib/* jars.
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
PluginClassLoader
protected PluginClassLoader(URL[] urls,
ClassLoader parent)
loadClass
protected Class<?> loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Overrides:
loadClass in class ClassLoader
- Throws:
ClassNotFoundException
destroy
public void destroy()
create
public static PluginClassLoader create(String pluginJarName,
URL pluginUrl,
boolean unpackNestedJars,
ClassLoader parent,
File tmpDirectory)
throws PluginContainerException
- Creates a classloader for the given named plugin whose plugin jar is found at the given URL.
- Parameters:
pluginJarName - the logical name of the pluginpluginUrl - the location where the plugin jar can be foundunpackNestedJars - if true, any lib/*.jar files found in the plugin jar
are unpacked and put in the classloaderparent - the parent classloader for the new classloader being createdtmpDirectory - the directory where the unpacked nested jars are placed
- Returns:
- the new plugin classloader
- Throws:
PluginContainerException
create
public static PluginClassLoader create(String pluginJarName,
URL[] pluginUrls,
boolean unpackNestedJars,
ClassLoader parent,
File tmpDirectory)
throws PluginContainerException
- Creates a classloader for the given named plugin whose plugin jar is found at the URL found
in the first index of the given URL array. The rest of the URLs in the array are to be added
to the classloader as additional jars.
- Parameters:
pluginJarName - the logical name of the pluginpluginUrls - the first element is the location where the plugin jar can be found, the remaining
are additional URLs to jars that will be added to the new classloaderunpackNestedJars - if true, any lib/*.jar files found in the plugin jar
are unpacked and put in the classloader. The additional jars are NEVER unpacked.parent - the parent classloader for the new classloader being createdtmpDirectory - the directory where the unpacked nested jars are placed
- Returns:
- the new plugin classloader
- Throws:
PluginContainerException
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.