public class SecureClassLoader extends ClassLoader
SecureClassLoader represents a ClassLoader which associates
the classes it loads with a code source and provide mechanisms to allow the
relevant permissions to be retrieved.proxyCache| Modifier | Constructor and Description |
|---|---|
protected |
SecureClassLoader()
Constructs a new instance of
SecureClassLoader. |
protected |
SecureClassLoader(ClassLoader parent)
Constructs a new instance of
SecureClassLoader with the specified
parent ClassLoader. |
| Modifier and Type | Method and Description |
|---|---|
protected Class<?> |
defineClass(String name,
byte[] b,
int off,
int len,
CodeSource cs)
Constructs a new class from an array of bytes containing a class
definition in class file format with an optional
CodeSource. |
protected Class<?> |
defineClass(String name,
ByteBuffer b,
CodeSource cs)
Constructs a new class from an array of bytes containing a class
definition in class file format with an optional
CodeSource. |
protected PermissionCollection |
getPermissions(CodeSource codesource)
Returns the
PermissionCollection for the specified CodeSource. |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersprotected SecureClassLoader()
SecureClassLoader. The default
parent ClassLoader is used.protected SecureClassLoader(ClassLoader parent)
SecureClassLoader with the specified
parent ClassLoader.parent - the parent ClassLoader.protected PermissionCollection getPermissions(CodeSource codesource)
PermissionCollection for the specified CodeSource.codesource - the code source.PermissionCollection for the specified CodeSource.protected final Class<?> defineClass(String name, byte[] b, int off, int len, CodeSource cs)
CodeSource.name - the name of the new class.b - a memory image of a class file.off - the start offset in b of the class data.len - the length of the class data.cs - the CodeSource, or null.IndexOutOfBoundsException - if off or len are not valid in respect to
b.ClassFormatError - if the specified data is not valid class data.SecurityException - if the package to which this class is to be added, already
contains classes which were signed by different certificates,
or if the class name begins with "java."protected final Class<?> defineClass(String name, ByteBuffer b, CodeSource cs)
CodeSource.name - the name of the new class.b - a memory image of a class file.cs - the CodeSource, or null.ClassFormatError - if the specified data is not valid class data.SecurityException - if the package to which this class is to be added, already
contains classes which were signed by different certificates,
or if the class name begins with "java."