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, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ComponentClassLoader(URL[] classpath, ClassLoader ownerClassLoader, String[] ownerFirstPackages, String[] componentFirstPackages)
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
public URL getResource(String name)
getResource
in class ClassLoader
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.