java.lang.Object
java.lang.ClassLoader
org.bzdev.lang.DMClassLoader
Deprecated.
Class loader supporting dynamic methods.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructor.DMClassLoader
(ClassLoader parent) Deprecated.Constructor. -
Method Summary
Methods 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, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
DMClassLoader
public DMClassLoader()Deprecated.Constructor. -
DMClassLoader
Deprecated.Constructor.- Parameters:
parent
- the parent class loader
-
-
Method Details
-
loadClass
Deprecated.Load a class.- Overrides:
loadClass
in classClassLoader
- Parameters:
name
- the class nameresolveIt
- true to resolve it; false otherwise- Throws:
ClassNotFoundException
-
The original documentation was:
With the default class loader, each local helper class has to be loaded explicitly, typically by calling the helper's
register()
static method from the corresponding class implementing a dynamic method.DMClassLoader
eliminates the need to do that by calling theregister()
methods automatically.To use this class loader as the system class loader, set the system property java.lang.class.loader to org.bzdev.lang.DMClassLoader when the JVM is started. One may also set the context class loader for each thread.
This class loader delegates class loading in the same way as
java.lang.ClassLoader
but adds the dynamic-method initialization described above. It also verifies that a class implementing dynamic methods and its local helper have the same code source and are in the same package.If run when the default security manager is installed, the runtime permission getProtectionDomain must be granted. This is used for verifying that dynamic-method annotations are in the same protection domain as this class loader, and that a class and its helper class are similarly in the same protection domain in addition to being in the same package.