Package ch.obermuhlner.scriptengine.java
Class MemoryClassLoader
java.lang.Object
java.lang.ClassLoader
ch.obermuhlner.scriptengine.java.MemoryClassLoader
A
ClassLoader
that loads classes from memory.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
URL used to identify theCodeSource
of theProtectionDomain
used by this class loader.private ProtectionDomain
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryClassLoader
(Map<String, byte[]> mapClassBytes, ClassLoader parent) Creates aMemoryClassLoader
. -
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
-
Field Details
-
MEMORY_CLASS_URL
URL used to identify theCodeSource
of theProtectionDomain
used by this class loader. This is useful to identify classes loaded by this class loader in a policy file.grant codeBase "jrt:/ch.obermuhlner.scriptengine.java/memory-class" { permission java.lang.RuntimePermission "exitVM"; };
- See Also:
-
protectionDomain
-
mapClassBytes
-
-
Constructor Details
-
MemoryClassLoader
Creates aMemoryClassLoader
.- Parameters:
mapClassBytes
- the map of class names to compiled classesparent
- the parentClassLoader
-
-
Method Details
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-