站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 common API Documentation 英文版文档

DelegatingClassLoader (JBoss/Common API) - JBoss 3.2.7 common API Documentation 英文版文档


org.jboss.util.loading
Class DelegatingClassLoader

java.lang.Object
  extended byjava.lang.ClassLoader
      extended byjava.security.SecureClassLoader
          extended byjava.net.URLClassLoader
              extended byorg.jboss.util.loading.DelegatingClassLoader

public class DelegatingClassLoader
extends URLClassLoader

A URL classloader that delegates to its parent, avoiding synchronization. A standard flag is provided so it can be used as a parent class, but later subclassed and to revert to standard class loading if the subclass wants to load classes.

Version:
$Revision: 1.1.2.1 $
Author:
Adrian Brock

Field Summary
static URL[] EMPTY_URL_ARRAY
          The value returned by getURLs.
protected  boolean standard
          Whether to use standard loading
 
Constructor Summary
DelegatingClassLoader(ClassLoader parent)
          Constructor
DelegatingClassLoader(ClassLoader parent, URLStreamHandlerFactory factory)
          Constructor
 
Method Summary
protected  Class loadClass(String className, boolean resolve)
          Load a class, by asking the parent
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_URL_ARRAY

public static final URL[] EMPTY_URL_ARRAY
The value returned by getURLs.


standard

protected boolean standard
Whether to use standard loading

Constructor Detail

DelegatingClassLoader

public DelegatingClassLoader(ClassLoader parent)
Constructor

Parameters:
parent - the parent classloader, cannot be null.

DelegatingClassLoader

public DelegatingClassLoader(ClassLoader parent,
                             URLStreamHandlerFactory factory)
Constructor

Parameters:
factory - the url stream factory.
Method Detail

loadClass

protected Class loadClass(String className,
                          boolean resolve)
                   throws ClassNotFoundException
Load a class, by asking the parent

Parameters:
className - the class name to load
resolve - whether to link the class
Returns:
the loaded class
Throws:
ClassNotFoundException - when the class could not be found


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.