Package dev.getelements.elements.sdk.spi
Class ElementClassLoader
java.lang.Object
java.lang.ClassLoader
dev.getelements.elements.sdk.spi.ElementClassLoader
A
ClassLoader type which inspects classes at load time processing the visibility annotations provided by the
Elements' SDK. Such annotations include ElementPrivate and ElementPublic. This implementation
allows for a separate hierarchy of classes to be loaded for each Element, while still allowing some parts of the
core system through. The delegate ClassLoader is typically the system class loader.-
Constructor Summary
ConstructorsConstructorDescriptionElementClassLoader(ClassLoader delegate) Creates a new instance ofElementClassLoaderwith the specified delegate class loader.ElementClassLoader(ClassLoader delegate, ClassLoader parent) Creates a new instance ofElementClassLoaderwith the specified delegate class loader. -
Method Summary
Modifier and TypeMethodDescriptionprotected URLfindResource(String name) protected Enumeration<URL> findResources(String name) protected Class<?> voidsetElementRecord(ElementRecord elementRecord) Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ElementClassLoader
Creates a new instance ofElementClassLoaderwith the specified delegate class loader. The delegate loader will be the sources for classes that are not found in this class loader. This is typically the system class path and the Element's class path. This constructor uses the bootstrap as the parent class loader.- Parameters:
delegate- the delegate class loader to use for loading classes that are not found in this class loader.
-
ElementClassLoader
Creates a new instance ofElementClassLoaderwith the specified delegate class loader. The delegate loader will be the sources for classes that are not found in this class loader. This is typically the system class path and the Element's class path.- Parameters:
delegate- the delegate class loader to use for loading classes that are not found in this class loader.parent- the parent class loader to use for loading classes that are not found in this class loader.
-
-
Method Details
-
getElementRecord
-
setElementRecord
-
findResource
- Overrides:
findResourcein classClassLoader
-
findResources
- Overrides:
findResourcesin classClassLoader- Throws:
IOException
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-