| java.net.URLClassLoader com.sun.jbi.framework.CustomClassLoader
CustomClassLoader | final public class CustomClassLoader extends java.net.URLClassLoader (Code) | | Implementation of a custom class loader.
There is one instance of this classloader per component lifecycle
/bootstrap/shared library.
This classloader subclasses java.net.URLClassLoader and implements
functionality to force 'local' loading of classes at the component
level before delegating it to the parent classloader .
This is to allow the component/SL to load specific versions of libraries
such as Xerces rather than be forced to use the JVM/Application Server
version of the same .
author: Sun Microsystems, Inc. |
Method Summary | |
public URL | getResource(String name) Overloaded getResource method that implements the 'selfFirst'
functionality . | public InputStream | getResourceAsStream(String name) Overloaded getResourceAsStream method for the 'selfFirst'
functionality . | public Class | loadClass(String name) Overloaded loadClass method that works similarly to the
loadClass(String, boolean) method with
false asthe second argument.
Parameters: name - The name of class to load. | protected Class | loadClass(String name, boolean resolve) Overloaded loadClass method that implements the 'selfFirst=true/false'
functionality . | public void | releaseResources() Releases all resources currently held in this classloader's cache. |
CustomClassLoader | public CustomClassLoader(URL[] urls, ClassLoader parentCL, boolean selfFirst)(Code) | | Constructor.
Parameters: urls - the urls to construct this class loader with Parameters: parentCL - the parent of the component class loader Parameters: selfFirst - flag indicating whether the componentshould try loading libraries itself first or delegate to its parent . |
getResource | public URL getResource(String name)(Code) | | Overloaded getResource method that implements the 'selfFirst'
functionality . We need to overload getResource instead of findResource
since we want to interfere with the normal Java2 class loading
sequence . By the time the findResource() method is called, the parent
class loader has already been asked to try and load the class - this
is exactly what we are trying to circumvent .
See Also: java.lang.ClassLoader.getResource(String) See Also: See Also: The sequence of looking for a resource is as follows - See Also: See Also: - if 'selfFirst=false' hand off the loading to the parent i.e.
See Also: the Delegating ClassLoader for this classloader. If parent is null See Also: the class loader built into the VM is used instead. See Also: - call findResource() to try loading the resource locally, if it
See Also: succeeds , hand back the resource , See Also: - finally hand control to parent and let the
See Also: normal delegation class loading continue. See Also: - if the resource was not found in above sequence, return NULL
See Also:
Parameters: name - The name of resource to load. The loaded resource. |
getResourceAsStream | public InputStream getResourceAsStream(String name)(Code) | | Overloaded getResourceAsStream method for the 'selfFirst'
functionality . We need to overload getResourceAsStream
since we want to interfere with the normal Java2 class loading
sequence .
See Also: java.lang.ClassLoader.getResourceAsStream(String) See Also: See Also: The sequence of looking for a resource is as follows - See Also: See Also: - if 'selfFirst=false' hand off the loading to the parent i.e.
See Also: the Delegating ClassLoader for this classloader. If parent is null See Also: the class loader built into the VM is used instead. See Also: - call findResourceAsStream() to try loading the resource locally,
See Also: if it succeeds , hand back the resource , See Also: - finally hand control to parent and let the
See Also: normal delegation class loading continue. See Also: - if the resource was not found in above sequence, return NULL
See Also:
Parameters: name - The name of resource to load. The loaded resource. |
loadClass | public Class loadClass(String name) throws ClassNotFoundException(Code) | | Overloaded loadClass method that works similarly to the
loadClass(String, boolean) method with
false asthe second argument.
Parameters: name - The name of class to load. The loaded class. throws: ClassNotFoundException - If the class cannot be loaded by thisclassloader. |
loadClass | protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException(Code) | | Overloaded loadClass method that implements the 'selfFirst=true/false'
functionality . We need to overload loadClass instead of findClass
since we want to interfere with the normal Java2 class loading
sequence . By the time the findClass() method is called, the parent
class loader has already been asked to try and load the class - this
is exactly what we are trying to circumvent .
See Also: java.lang.ClassLoader.loadClass(Stringboolean) See Also: See Also: java.lang.ClassLoader.findClass(String) See Also: See Also: The sequence of looking for a class is as follows - See Also: See Also: - call findLoadedClass(String) to check if the class has
See Also: already been loaded. See Also: - if 'selfFirst=false' hand off the loading to the parent i.e.
See Also: the Delegating ClassLoader for this classloader. If parent is null See Also: the class loader built into the VM is used instead. See Also: - call findClass() to try loading the class locally, if it
See Also: succeeds , hand back the class See Also: - finally hand control to parent and let the normal delegation
See Also: class loading continue. See Also: - if class was not found in above sequence, throw a
See Also: ClassNotFoundException See Also: - resolveClass is called at each stage before returning the
See Also: loaded class See Also:
Parameters: name - The name of class to load. Parameters: resolve - whether or not to reolve the loaded class. The loaded class. throws: ClassNotFoundException - If the class cannot be loaded by thisclassloader. |
releaseResources | public void releaseResources()(Code) | | Releases all resources currently held in this classloader's cache.
|
|
|