Package com.nomagic.magicreport
Class ExtensionClassLoader
java.lang.Object
java.lang.ClassLoader
com.nomagic.magicreport.ExtensionClassLoader
This class loader is used to provide class loader for MagicReport extension. This loader will load classes and
resources from a search URLs referring to JAR files and prevent resource locking from class loader.
- Since:
- Mar 28, 2008
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionClassLoader(URL url) Constructs a new URLClassLoader for the specified URL using the system class loader as parentClassLoader.ExtensionClassLoader(URL[] urls) Constructs a new URLClassLoader for the specified URLs using the system class loader as parentClassLoader.ExtensionClassLoader(URL[] urls, ClassLoader parent) Constructs a new ExtensionClassLoader for the given URLs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOtherClassLoader(ClassLoader otherClassLoader) Add other class loaderReturn other class loaders for delegationReturn parent class loader for delegationReturn url class loaderClass<?> protected Class<?> voidsetOtherClassLoader(List<ClassLoader> otherClassLoaders) Set other class loaders for delegationMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ExtensionClassLoader
Constructs a new URLClassLoader for the specified URL using the system class loader as parentClassLoader. The URL will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.- Parameters:
url- the URL from which to load classes and resources
-
ExtensionClassLoader
Constructs a new URLClassLoader for the specified URLs using the system class loader as parentClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.- Parameters:
urls- the URLs from which to load classes and resources
-
ExtensionClassLoader
Constructs a new ExtensionClassLoader for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.- Parameters:
urls- the URLs from which to load classes and resourcesparent- the parent class loader for delegation
-
-
Method Details
-
getURLClassLoader
Return url class loader- Returns:
- URLClassLoader
-
getParentClassLoader
Return parent class loader for delegation- Returns:
- parent class loader
-
getOtherClassLoaders
Return other class loaders for delegation- Returns:
- OtherClassLoaders
-
setOtherClassLoader
Set other class loaders for delegation- Parameters:
otherClassLoaders- other class loaders for delegation
-
addOtherClassLoader
Add other class loader- Parameters:
otherClassLoader- other class loaders for delegation
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-