|
||||||||||
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 org.apache.geronimo.kernel.config.MultiParentClassLoader
public class MultiParentClassLoader
A MultiParentClassLoader is a simple extension of the URLClassLoader that simply changes the single parent class loader model to support a list of parent class loaders. Each operation that accesses a parent, has been replaced with a operation that checks each parent in order. This getParent method of this class will always return null, which may be interpreted by the calling code to mean that this class loader is a direct child of the system class loader.
Constructor Summary | |
---|---|
MultiParentClassLoader(Artifact id,
URL[] urls)
Creates a named class loader with no parents. |
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader parent)
Creates a named class loader as a child of the specified parent. |
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents)
Creates a named class loader as a child of the specified parents. |
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents,
boolean inverseClassLoading,
Collection hiddenClasses,
Collection nonOverridableClasses)
|
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents,
boolean inverseClassLoading,
String[] hiddenClasses,
String[] nonOverridableClasses)
|
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents,
URLStreamHandlerFactory factory)
Creates a named class loader as a child of the specified parents and using the specified URLStreamHandlerFactory for accessing the urls.. |
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader parent,
boolean inverseClassLoading,
String[] hiddenClasses,
String[] nonOverridableClasses)
|
|
MultiParentClassLoader(Artifact id,
URL[] urls,
ClassLoader parent,
URLStreamHandlerFactory factory)
Creates a named class loader as a child of the specified parent and using the specified URLStreamHandlerFactory for accessing the urls.. |
|
MultiParentClassLoader(MultiParentClassLoader source)
|
Method Summary | |
---|---|
void |
addURL(URL url)
|
void |
destroy()
|
protected void |
finalize()
|
Enumeration<URL> |
findResources(String name)
|
Artifact |
getId()
Gets the id of this class loader. |
ClassLoader[] |
getParents()
Gets the parents of this class loader. |
URL |
getResource(String name)
|
protected Enumeration<URL> |
internalfindResources(String name)
|
boolean |
isDestroyed()
|
protected Class<?> |
loadClass(String name,
boolean resolve)
TODO This method should be removed and replaced with the best classLoading option. |
protected Class<?> |
loadClassInternal(String name,
boolean resolve,
LinkedList<ClassLoader> visitedClassLoaders)
This method is an internal hook that allows us to be performant on Class lookups when multiparent classloaders are involved. |
protected Class<?> |
loadOptimizedClass(String name,
boolean resolve)
Optimized classloading. |
protected Class<?> |
loadSafeClass(String name,
boolean resolve)
This method executes the old class loading behaviour before optimization. |
protected void |
recursiveFind(Set<ClassLoader> knownClassloaders,
List<Enumeration<URL>> enumerations,
String name)
|
String |
toString()
|
Methods inherited from class java.net.URLClassLoader |
---|
definePackage, findClass, findResource, getPermissions, getURLs, newInstance, newInstance |
Methods inherited from class java.security.SecureClassLoader |
---|
defineClass, defineClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiParentClassLoader(Artifact id, URL[] urls)
id
- the id of this class loaderurls
- the urls from which this class loader will classes and resourcespublic MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader parent)
id
- the id of this class loaderurls
- the urls from which this class loader will classes and resourcesparent
- the parent of this class loaderpublic MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses)
public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory)
id
- the id of this class loaderurls
- the urls from which this class loader will classes and resourcesparent
- the parent of this class loaderfactory
- the URLStreamHandlerFactory used to access the urlspublic MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents)
id
- the id of this class loaderurls
- the urls from which this class loader will classes and resourcesparents
- the parents of this class loaderpublic MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses)
public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses)
public MultiParentClassLoader(MultiParentClassLoader source)
public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, URLStreamHandlerFactory factory)
id
- the id of this class loaderurls
- the urls from which this class loader will classes and resourcesparents
- the parents of this class loaderfactory
- the URLStreamHandlerFactory used to access the urlsMethod Detail |
---|
public Artifact getId()
public ClassLoader[] getParents()
public void addURL(URL url)
addURL
in class URLClassLoader
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class<?> loadSafeClass(String name, boolean resolve) throws ClassNotFoundException
name
- resolve
-
ClassNotFoundException
protected Class<?> loadOptimizedClass(String name, boolean resolve) throws ClassNotFoundException
ClassNotFoundException
protected Class<?> loadClassInternal(String name, boolean resolve, LinkedList<ClassLoader> visitedClassLoaders) throws ClassNotFoundException
name
- visitedClassLoaders
-
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
public Enumeration<URL> findResources(String name) throws IOException
findResources
in class URLClassLoader
IOException
protected void recursiveFind(Set<ClassLoader> knownClassloaders, List<Enumeration<URL>> enumerations, String name) throws IOException
IOException
protected Enumeration<URL> internalfindResources(String name) throws IOException
IOException
public String toString()
toString
in class Object
public boolean isDestroyed()
public void destroy()
protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |