Package org.apache.axis2.classloader
Class JarFileClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.apache.axis2.classloader.MultiParentClassLoader
org.apache.axis2.classloader.JarFileClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable,BeanInfoCachingClassLoader
public class JarFileClassLoader
extends MultiParentClassLoader
implements BeanInfoCachingClassLoader
The JarFileClassLoader that loads classes and resources from a list of JarFiles. This method is simmilar to URLClassLoader
except it properly closes JarFiles when the classloader is destroyed so that the file read lock will be released, and
the jar file can be modified and deleted.
- Version:
- $Rev: 725315 $ $Date: 2008-12-10 21:15:38 +0530 (Wed, 10 Dec 2008) $
-
Constructor Summary
ConstructorsConstructorDescriptionJarFileClassLoader(URL[] urls) Creates a JarFileClassLoader that is a child of the system class loader.JarFileClassLoader(URL[] urls, ClassLoader parent) Creates a JarFileClassLoader that is a child of the specified class loader.JarFileClassLoader(URL[] urls, ClassLoader[] parents) Creates a named class loader as a child of the specified parents.JarFileClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) JarFileClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses) JarFileClassLoader(URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) JarFileClassLoader(JarFileClassLoader source) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidAdds an array of urls to the end of this class loader.static ClassLoadercopy(ClassLoader source) voiddestroy()protected Classprotected StringfindLibrary(String libraryName) findResource(String resourceName) final BeanInfoCacheGet theBeanInfocache for this class loader.URL[]getURLs()protected Enumeration<URL> internalfindResources(String name) Methods inherited from class org.apache.axis2.classloader.MultiParentClassLoader
findResources, getParents, getResource, isDestroyed, loadClass, toStringMethods inherited from class java.net.URLClassLoader
close, definePackage, getPermissions, getResourceAsStream, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, 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
-
JarFileClassLoader
Creates a JarFileClassLoader that is a child of the system class loader.- Parameters:
urls- a list of URLs from which classes and resources should be loaded
-
JarFileClassLoader
Creates a JarFileClassLoader that is a child of the specified class loader.- Parameters:
urls- a list of URLs from which classes and resources should be loadedparent- the parent of this class loader
-
JarFileClassLoader
public JarFileClassLoader(URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) -
JarFileClassLoader
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
-
JarFileClassLoader
public JarFileClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses) -
JarFileClassLoader
public JarFileClassLoader(URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses) -
JarFileClassLoader
-
-
Method Details
-
copy
-
getURLs
- Overrides:
getURLsin classURLClassLoader
-
addURL
- Overrides:
addURLin classMultiParentClassLoader
-
addURLs
Adds an array of urls to the end of this class loader.- Parameters:
urls- the URLs to add
-
destroy
public void destroy()- Overrides:
destroyin classMultiParentClassLoader
-
findResource
- Overrides:
findResourcein classURLClassLoader
-
internalfindResources
- Throws:
IOException
-
findLibrary
- Overrides:
findLibraryin classClassLoader
-
findClass
- Overrides:
findClassin classURLClassLoader- Throws:
ClassNotFoundException
-
getBeanInfoCache
Description copied from interface:BeanInfoCachingClassLoaderGet theBeanInfocache for this class loader.- Specified by:
getBeanInfoCachein interfaceBeanInfoCachingClassLoader- Returns:
- the cache instance; must not be
null
-