Package org.apache.axis2.classloader
Class MultiParentClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.axis2.classloader.MultiParentClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
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.
- Version:
- $Rev$ $Date$
-
Constructor Summary
ConstructorsConstructorDescriptionMultiParentClassLoader(URL[] urls) Creates a named class loader with no parents.MultiParentClassLoader(URL[] urls, ClassLoader parent) Creates a named class loader as a child of the specified parent.MultiParentClassLoader(URL[] urls, ClassLoader[] parents) Creates a named class loader as a child of the specified parents.MultiParentClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) MultiParentClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses) MultiParentClassLoader(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(URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) MultiParentClassLoader(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.. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()findResources(String name) Gets the parents of this class loader.getResource(String name) booleanprotected ClasstoString()Methods inherited from class java.net.URLClassLoader
close, definePackage, findClass, findResource, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
MultiParentClassLoader
Creates a named class loader with no parents.- Parameters:
urls- the urls from which this class loader will classes and resources
-
MultiParentClassLoader
Creates a named class loader as a child of the specified parent.- Parameters:
urls- the urls from which this class loader will classes and resourcesparent- the parent of this class loader
-
MultiParentClassLoader
public MultiParentClassLoader(URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) -
MultiParentClassLoader
Creates a named class loader as a child of the specified parent and using the specified URLStreamHandlerFactory for accessing the urls..- Parameters:
urls- the urls from which this class loader will classes and resourcesparent- the parent of this class loaderfactory- the URLStreamHandlerFactory used to access the urls
-
MultiParentClassLoader
Creates a named class loader as a child of the specified parents.- Parameters:
urls- the urls from which this class loader will classes and resourcesparents- the parents of this class loader
-
MultiParentClassLoader
public MultiParentClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses) -
MultiParentClassLoader
public MultiParentClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) -
MultiParentClassLoader
-
MultiParentClassLoader
Creates a named class loader as a child of the specified parents and using the specified URLStreamHandlerFactory for accessing the urls..- Parameters:
urls- the urls from which this class loader will classes and resourcesparents- the parents of this class loaderfactory- the URLStreamHandlerFactory used to access the urls
-
-
Method Details
-
getParents
Gets the parents of this class loader.- Returns:
- the parents of this class loader
-
addURL
- Overrides:
addURLin classURLClassLoader
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
getResource
- Overrides:
getResourcein classClassLoader
-
findResources
- Overrides:
findResourcesin classURLClassLoader- Throws:
IOException
-
toString
-
isDestroyed
public boolean isDestroyed() -
destroy
public void destroy()
-