| java.lang.Object java.lang.ClassLoader java.security.SecureClassLoader com.sun.jbi.framework.DelegatingClassLoader
DelegatingClassLoader | final public class DelegatingClassLoader extends java.security.SecureClassLoader (Code) | | Implementation of a Component's delegating classloader.
There is one instance of this classloader per component.
This classloader walks through a chain of shared classloaders
to try and load a class. It returns as soon as the first classloader
in the chain is able to find the correct classloader.
author: Sun Microsystems, Inc. |
Method Summary | |
public void | addSharedClassLoader(ClassLoader sharedLoader) Adds a Shared Library classloader to this instance of the DCL. | public Class | findClass(String name) Overloaded findClass method to walk through the shared classloader chain.
Parameters: name - The name of class to load. | 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 .
The purpose of overloading loadClass() here is
not to implement the Shared Class "selfFirst" logic as it may seem. |
DelegatingClassLoader | public DelegatingClassLoader(ClassLoader parent)(Code) | | Constructor.
Parameters: parent - the parent classloader to this DelegatingClassloader |
addSharedClassLoader | public void addSharedClassLoader(ClassLoader sharedLoader) throws IllegalArgumentException(Code) | | Adds a Shared Library classloader to this instance of the DCL.
Parameters: sharedLoader - The instance of shared classloader to add. throws: IllegalArgumentException - If the shared classloader passed inis null. |
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 .
The purpose of overloading loadClass() here is
not to implement the Shared Class "selfFirst" logic as it may seem.
That happens inside the Shared Classloaders themselves when invoked
inside findClass() of this class .
The purpose of this method is to prevent shared classes such as XML
libraries that may be found in the Appserver class path from being
inadvertently loaded ahead of time by the DelegatingClassLoader rather
than the class loaders for the Shared Libraries that contain the XML
library . This can happen because findClass() inside
DelegatingClassLoader is called after its parent (app server) class
loader has been consulted . DelegatingClassLoader is not a real class
loader - just a proxy for the shared class loaders and this method
ensures that the behaviour is as such . By finally delegating to the
parent app server class loader , this method ensures that class
loading failures do not occur for components that do not have
shared libraries and hence shared class loaders.
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: - 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 resolve the class definition The loaded class. throws: ClassNotFoundException - If the class cannot be loaded by thisclassloader. |
Methods inherited from java.lang.ClassLoader | public synchronized void clearAssertionStatus()(Code)(Java Doc) final protected Class> defineClass(byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc) final protected Class> defineClass(String name, byte[] b, int off, int len) throws ClassFormatError(Code)(Java Doc) final protected Class> defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc) final protected Class> defineClass(String name, java.nio.ByteBuffer b, ProtectionDomain protectionDomain) throws ClassFormatError(Code)(Java Doc) protected Package definePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException(Code)(Java Doc) protected Class> findClass(String name) throws ClassNotFoundException(Code)(Java Doc) protected String findLibrary(String libname)(Code)(Java Doc) final protected Class> findLoadedClass(String name)(Code)(Java Doc) protected URL findResource(String name)(Code)(Java Doc) protected Enumeration<URL> findResources(String name) throws IOException(Code)(Java Doc) final protected Class> findSystemClass(String name) throws ClassNotFoundException(Code)(Java Doc) protected Package getPackage(String name)(Code)(Java Doc) protected Package[] getPackages()(Code)(Java Doc) final public ClassLoader getParent()(Code)(Java Doc) public URL getResource(String name)(Code)(Java Doc) public InputStream getResourceAsStream(String name)(Code)(Java Doc) public Enumeration<URL> getResources(String name) throws IOException(Code)(Java Doc) public static ClassLoader getSystemClassLoader()(Code)(Java Doc) public static URL getSystemResource(String name)(Code)(Java Doc) public static InputStream getSystemResourceAsStream(String name)(Code)(Java Doc) public static Enumeration<URL> getSystemResources(String name) throws IOException(Code)(Java Doc) public Class> loadClass(String name) throws ClassNotFoundException(Code)(Java Doc) protected synchronized Class> loadClass(String name, boolean resolve) throws ClassNotFoundException(Code)(Java Doc) final protected void resolveClass(Class> c)(Code)(Java Doc) public synchronized void setClassAssertionStatus(String className, boolean enabled)(Code)(Java Doc) public synchronized void setDefaultAssertionStatus(boolean enabled)(Code)(Java Doc) public synchronized void setPackageAssertionStatus(String packageName, boolean enabled)(Code)(Java Doc) final protected void setSigners(Class> c, Object[] signers)(Code)(Java Doc)
|
|
|