|
||||||||||
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 org.apache.geronimo.kernel.classloader.JarFileClassLoader
public class JarFileClassLoader
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.
Note: This implementation currently does not work reliably on windows, since the jar URL handler included with the Sun JavaVM holds a read lock on the JarFile, and this lock is not released when the jar url is dereferenced. To fix this a replacement for the jar url handler must be written.
Constructor Summary | |
---|---|
JarFileClassLoader(Artifact id,
URL[] urls)
Creates a JarFileClassLoader that is a child of the system class loader. |
|
JarFileClassLoader(Artifact id,
URL[] urls,
ClassLoader parent)
Creates a JarFileClassLoader that is a child of the specified class loader. |
|
JarFileClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents)
Creates a named class loader as a child of the specified parents. |
|
JarFileClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents,
boolean inverseClassLoading,
Collection hiddenClasses,
Collection nonOverridableClasses)
|
|
JarFileClassLoader(Artifact id,
URL[] urls,
ClassLoader[] parents,
boolean inverseClassLoading,
String[] hiddenClasses,
String[] nonOverridableClasses)
|
|
JarFileClassLoader(Artifact id,
URL[] urls,
ClassLoader parent,
boolean inverseClassLoading,
String[] hiddenClasses,
String[] nonOverridableClasses)
|
|
JarFileClassLoader(JarFileClassLoader source)
|
Method Summary | |
---|---|
void |
addURL(URL url)
|
protected void |
addURLs(URL[] urls)
Adds an array of urls to the end of this class loader. |
static ClassLoader |
copy(ClassLoader source)
|
void |
destroy()
|
protected Class |
findClass(String className)
|
protected String |
findLibrary(String libraryName)
|
URL |
findResource(String resourceName)
|
URL[] |
getURLs()
|
protected Enumeration<URL> |
internalfindResources(String name)
|
Methods inherited from class org.apache.geronimo.kernel.config.MultiParentClassLoader |
---|
finalize, findResources, getId, getParents, getResource, isDestroyed, loadClass, loadClassInternal, loadOptimizedClass, loadSafeClass, recursiveFind, toString |
Methods inherited from class java.net.URLClassLoader |
---|
definePackage, getPermissions, 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 JarFileClassLoader(Artifact id, URL[] urls)
id
- the name of this class loaderurls
- a list of URLs from which classes and resources should be loadedpublic JarFileClassLoader(Artifact id, URL[] urls, ClassLoader parent)
id
- the name of this class loaderurls
- a list of URLs from which classes and resources should be loadedparent
- the parent of this class loaderpublic JarFileClassLoader(Artifact id, URL[] urls, ClassLoader parent, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses)
public JarFileClassLoader(Artifact id, URL[] urls, ClassLoader[] parents)
id
- the name of this class loaderurls
- the urls from which this class loader will classes and resourcesparents
- the parents of this class loaderpublic JarFileClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, Collection hiddenClasses, Collection nonOverridableClasses)
public JarFileClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, boolean inverseClassLoading, String[] hiddenClasses, String[] nonOverridableClasses)
public JarFileClassLoader(JarFileClassLoader source)
Method Detail |
---|
public static ClassLoader copy(ClassLoader source)
public URL[] getURLs()
getURLs
in class URLClassLoader
public void addURL(URL url)
addURL
in class MultiParentClassLoader
protected void addURLs(URL[] urls)
urls
- the URLs to addpublic void destroy()
destroy
in class MultiParentClassLoader
public URL findResource(String resourceName)
findResource
in class URLClassLoader
protected Enumeration<URL> internalfindResources(String name) throws IOException
internalfindResources
in class MultiParentClassLoader
IOException
protected String findLibrary(String libraryName)
findLibrary
in class ClassLoader
protected Class findClass(String className) throws ClassNotFoundException
findClass
in class URLClassLoader
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |