Class GuardClassLoader
java.lang.Object
java.lang.ClassLoader
org.codehaus.commons.compiler.sandbox.GuardClassLoader
Makes
Guard and the types of its signatures and exceptions (SandboxLimitExceededError, SandboxLimits), including their nested classes, visible to the code that JANINO instruments, even if the parent
class loader cannot see them (e.g. because it is the platform class loader), and makes sure that the code uses the
same Guard class as the SandboxExecutor. All other classes are loaded through the parent class
loader.-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoadercreate(ClassLoader parent) static Class<?> getGuardClass(String className) protected Class<?> Methods inherited from class ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Method Details
-
create
- Parameters:
parent-nullmeans the bootstrap class loader
-
getGuardClass
- Returns:
- The named class if it is one of the classes that this class loader provides
(see above), otherwise
null - Throws:
ClassNotFoundException- The name designates a nested class of these classes that does not exist
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-