public class ComponentClassLoader extends URLClassLoader
URLClassLoader that restricts which classes can be loaded to those contained within the
given classpath, except classes from a given set of packages that are either loaded owner or
component-first.
Depiction of the class loader hierarchy:
Owner Bootstrap
^ ^
|---------|
|
Component
For loading classes/resources, class loaders are accessed in one of the following orders:
| Constructor and Description |
|---|
ComponentClassLoader(URL[] classpath,
ClassLoader ownerClassLoader,
String[] ownerFirstPackages,
String[] componentFirstPackages) |
| Modifier and Type | Method and Description |
|---|---|
URL |
getResource(String name) |
Enumeration<URL> |
getResources(String name) |
protected Class<?> |
loadClass(String name,
boolean resolve) |
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic ComponentClassLoader(URL[] classpath, ClassLoader ownerClassLoader, String[] ownerFirstPackages, String[] componentFirstPackages)
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionpublic URL getResource(String name)
getResource in class ClassLoaderpublic Enumeration<URL> getResources(String name) throws IOException
getResources in class ClassLoaderIOExceptionCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.