org.rhq.enterprise.server.plugin.pc
Class RootServerPluginClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.rhq.enterprise.server.plugin.pc.RootServerPluginClassLoader
public class RootServerPluginClassLoader
- extends URLClassLoader
This is the classloader that will be the parent to all plugin classloaders. It will be created such that
it essentially hides a set of excluded classes which typically means this this root classloader (and its
children plugin classloaders) will allow the following to be loaded:
- the plugin itself (including its third-party libraries)
- core plugin container libraries required by all plugins, such as plugin API classes
- plugin container jars that are configured to be unhidden
- Author:
- John Mazzitelli
| Methods inherited from class java.lang.ClassLoader |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResourceAsStream, 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 |
RootServerPluginClassLoader
public RootServerPluginClassLoader(URL[] urls,
ClassLoader parent,
String... classesToHideRegexStr)
- Creates this classloader.
classesToHideRegexStr is a regular expression to use to match against names
of classes to hide (i.e. not load). If a class that is to be loaded doesn't match the regex, it will be loaded
using parent-first semantics (i.e. it will first be searched in the parent classloader, and only if it isn't found
there will this classloader be checked for it). Otherwise, the class will be loaded using this classloader
only - the parent classloader will not be consulted so if this classloader does not have the class to be loaded, a
ClassCastException will be thrown.
- Parameters:
urls - URLs to jar files where classes can be loaded by this classloaderparent - the parent to this classloader, used when loading classes via parent-first semanticsclassesToHideRegexStr - regular expression(s) to use to match against names of classes to load.
if null or empty, no classes will be hidden, the parent will always
be consulted first to load the classes.
- Throws:
PatternSyntaxException - if the given regex is invalid (see Pattern.compile(String))
loadClass
protected Class<?> loadClass(String name,
boolean resolve)
throws ClassNotFoundException
- Overrides:
loadClass in class ClassLoader
- Throws:
ClassNotFoundException
getResource
public URL getResource(String name)
- Overrides:
getResource in class ClassLoader
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.