com.sun.enterprise.module.impl
Class ClassLoaderProxy

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by com.sun.enterprise.module.impl.ClassLoaderProxy

public class ClassLoaderProxy
extends URLClassLoader

ClassLoaderProxy capable of loading classes from itself but also from other class loaders

Author:
Jerome Dochez

Constructor Summary
ClassLoaderProxy(URL[] shared, ClassLoader parent)
          Creates a new instance of ClassLoader
 
Method Summary
 void addDelegate(ClassLoader cl)
           
 void addURL(URL url)
          Appends the specified URL to the list of URLs to search for classes and resources.
protected  void finalize()
           
protected  Class<?> findClass(String name)
           
protected  Class<?> findClass(String name, boolean followImports)
           
 URL findResource(String name)
           
 URL findResourceDirect(String name)
          Works like findResource(String) but only looks at this module, without delegating to ancestors.
 Enumeration<URL> findResources(String name)
           
 Collection<ClassLoader> getDelegates()
           
protected  Class<?> loadClass(String name, boolean resolve, boolean followImports)
           
 void removeDelegate(ClassLoader cl)
           
 void stop()
          called by the facade class loader when it is garbage collected.
 String toString()
           
 
Methods inherited from class java.net.URLClassLoader
definePackage, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassLoaderProxy

public ClassLoaderProxy(URL[] shared,
                        ClassLoader parent)
Creates a new instance of ClassLoader

Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

loadClass

protected Class<?> loadClass(String name,
                             boolean resolve,
                             boolean followImports)
                      throws ClassNotFoundException
Throws:
ClassNotFoundException

findClass

protected Class<?> findClass(String name)
                      throws ClassNotFoundException
Overrides:
findClass in class URLClassLoader
Throws:
ClassNotFoundException

findClass

protected Class<?> findClass(String name,
                             boolean followImports)
                      throws ClassNotFoundException
Throws:
ClassNotFoundException

findResource

public URL findResource(String name)
Overrides:
findResource in class URLClassLoader

findResourceDirect

public URL findResourceDirect(String name)
Works like findResource(String) but only looks at this module, without delegating to ancestors.


findResources

public Enumeration<URL> findResources(String name)
                               throws IOException
Overrides:
findResources in class URLClassLoader
Throws:
IOException

addDelegate

public void addDelegate(ClassLoader cl)

removeDelegate

public void removeDelegate(ClassLoader cl)

getDelegates

public Collection<ClassLoader> getDelegates()

stop

public void stop()
called by the facade class loader when it is garbage collected. this is a good time to see if this module should be unloaded.


toString

public String toString()
Overrides:
toString in class Object

addURL

public void addURL(URL url)
Appends the specified URL to the list of URLs to search for classes and resources.

Overrides:
addURL in class URLClassLoader
Parameters:
url - the url to append


Copyright © 2013 Oracle Corporation. All Rights Reserved.