Package org.restheart.plugins
Class PluginsClassloader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.restheart.plugins.PluginsClassloader
- All Implemented Interfaces:
Closeable,AutoCloseable
Loads a class, including searching within all plugin JAR files.
This method is essential for the collectFieldInjections() method, which processes field injections
annotated with @Inject. Specifically, it addresses cases where the @Inject annotation
references a Provider that returns an object. The class of this object may reside
in a plugin JAR file, necessitating a comprehensive search to locate and load the class correctly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PluginsClassloaderstatic voidcall after PluginsScanner.jars array is populatedstatic booleanClass<?> Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Method Details
-
init
call after PluginsScanner.jars array is populated- Parameters:
jars-
-
isInitialized
public static boolean isInitialized() -
getInstance
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-