ClassLoader with additional support for defining
classes with an associated code source and permissions.
API Note
Permissions cannot be used for controlling access to resources as the Security Manager is no longer supported.
| Modifier and Type | Class and Description |
|---|---|
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final Map |
| Access | Constructor and Description |
|---|---|
| protected | SecureClassLoader(ClassLoader
the parent ClassLoader, can be parent)null for the bootstrap
class loaderCreates a new |
| protected | |
| protected | SecureClassLoader(String
class loader name; or name, ClassLoader null if not namedthe parent class loader, can be parent)null for the bootstrap
class loaderCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| protected final Class | Returns: theClass object created from the data,
and optional CodeSource.the expected name of the class, or name, byte[] null
if not known, using '.' and not '/' as the separator
and without a trailing ".class" suffix.the bytes that make up the class data. The bytes in
positions b, int off through off+len-1
should have the format of a valid class file as defined by
The Java Virtual Machine Specification.the start offset in off, int b of the class datathe length of the class data len, CodeSource the associated CodeSource, or cs)null if noneConverts an array of bytes into an instance of class |
| protected final Class | Returns: theClass object created from the data,
and optional CodeSource.the expected name of the class, or name, ByteBuffer null
if not known, using '.' and not '/' as the separator
and without a trailing ".class" suffix.the bytes that make up the class data. The bytes from positions
b, CodeSource b.position() through b.position() + b.limit() -1
should have the format of a valid class file as defined by
The Java Virtual Machine Specification.the associated CodeSource, or cs)null if noneConverts a |
| protected PermissionCollection | Returns: the permissions for the codesource.the codesource. codesource)Returns the permissions for the given CodeSource object. |
| private ProtectionDomain | |
| private void | resetArchivedStates()
Hides java. Called by the VM, during -Xshare:dump |
| pdcache | back to summary |
|---|---|
| private final Map<SecureClassLoader. | |
| SecureClassLoader | back to summary |
|---|---|
| protected SecureClassLoader(ClassLoader parent) Creates a new API Note If
| |
| SecureClassLoader | back to summary |
|---|---|
| protected SecureClassLoader() Creates a new | |
| SecureClassLoader | back to summary |
|---|---|
| protected SecureClassLoader(String name, ClassLoader parent) Creates a new API Note If
| |
| defineClass | back to summary |
|---|---|
| protected final Class Converts an array of bytes into an instance of class If a non-null CodeSource is supplied a ProtectionDomain is constructed and associated with the class being defined.
| |
| defineClass | back to summary |
|---|---|
| protected final Class Converts a If a non-null CodeSource is supplied a ProtectionDomain is constructed and associated with the class being defined.
| |
| getPermissions | back to summary |
|---|---|
| protected PermissionCollection getPermissions(CodeSource codesource) Returns the permissions for the given CodeSource object. This method is invoked by the defineClass method which takes a CodeSource as an argument when it is constructing the ProtectionDomain for the class being defined.
| |
| getProtectionDomain | back to summary |
|---|---|
| private ProtectionDomain getProtectionDomain(CodeSource cs) | |
| resetArchivedStates | back to summary |
|---|---|
| private void resetArchivedStates() Hides java. Called by the VM, during -Xshare:dump | |
| Modifier and Type | Field and Description |
|---|---|
| private final CodeSource |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public CodeSource | |
| public boolean | equals(Object obj)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| cs | back to summary |
|---|---|
| private final CodeSource cs Record Component accessed by cs(). | |
| CodeSourceKey | back to summary |
|---|---|
| private CodeSourceKey(CodeSource cs) | |
| cs | back to summary |
|---|---|
| public CodeSource cs() Record Component getter of cs. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |