ProtectionDomain
class encapsulates the characteristics of a
domain, which encloses a set of classes whose instances are granted a set
of permissions when being executed on behalf of a given set of Principals.
A static set of permissions can be bound to a ProtectionDomain
when it is constructed; such permissions are granted to the domain
regardless of the policy in force. However, to support dynamic security
policies, a ProtectionDomain
can also be constructed such that it
is dynamically mapped to a set of permissions by the current policy whenever
a permission is checked.
Modifier and Type | Class and Description |
---|---|
private static class | |
private static class | |
pack-priv static class | ProtectionDomain.
Used for storing ProtectionDomains as keys in a Map. |
Modifier and Type | Field and Description |
---|---|
private final ClassLoader | |
private final CodeSource | |
private static final boolean | filePermCompatInPD
If |
private boolean | |
pack-priv final ProtectionDomain. | |
private PermissionCollection | |
private final Principal[] | |
private final boolean |
Access | Constructor and Description |
---|---|
public | ProtectionDomain(CodeSource
the codesource associated with this domain codesource, PermissionCollection the permissions granted to this domain permissions)Creates a new |
public | ProtectionDomain(CodeSource
the codesource, PermissionCollection CodeSource associated with this domainthe permissions granted to this domain permissions, ClassLoader the classloader, Principal[] ClassLoader associated with this domainthe array of principals)Principal objects associated
with this domain. The contents of the array are copied to protect against
subsequent modification.Creates a new |
Modifier and Type | Method and Description |
---|---|
public final ClassLoader | Returns: theClassLoader of this domain which may be null .Returns the |
public final CodeSource | Returns: theCodeSource of this domain which may be null .Returns the |
public final PermissionCollection | Returns: the static set of permissions for this domain which may benull .Returns the static permissions granted to this domain. |
public final Principal[] | Returns: a non-null array of principals for this domain. Returns a new array each time this method is called.Returns an array of principals for this domain. |
public boolean | Returns: true if perm is implied by this
ProtectionDomain .the {code Permission} object to check. perm)Check and see if this |
pack-priv boolean | impliesWithAltFilePerm(Permission perm)
This method has almost the same logic flow as |
private PermissionCollection | |
private static boolean | |
public final boolean | Returns: true if this domain contains only static permissions.Returns |
public String |
classloader | back to summary |
---|---|
private final ClassLoader classloader |
codesource | back to summary |
---|---|
private final CodeSource codesource |
filePermCompatInPD | back to summary |
---|---|
private static final boolean filePermCompatInPD If |
hasAllPerm | back to summary |
---|---|
private boolean hasAllPerm |
key | back to summary |
---|---|
pack-priv final ProtectionDomain. |
permissions | back to summary |
---|---|
private PermissionCollection permissions |
principals | back to summary |
---|---|
private final Principal[] principals |
staticPermissions | back to summary |
---|---|
private final boolean staticPermissions |
ProtectionDomain | back to summary |
---|---|
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions) Creates a new
The permissions granted to this domain are static, i.e.
invoking the
|
ProtectionDomain | back to summary |
---|---|
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions, ClassLoader classloader, Principal[] principals) Creates a new
The permissions granted to this domain are dynamic, i.e.
invoking the
This constructor is typically used by
|
getClassLoader | back to summary |
---|---|
public final ClassLoader getClassLoader() Returns the
|
getCodeSource | back to summary |
---|---|
public final CodeSource getCodeSource() Returns the
|
getPermissions | back to summary |
---|---|
public final PermissionCollection getPermissions() Returns the static permissions granted to this domain.
|
getPrincipals | back to summary |
---|---|
public final Principal[] getPrincipals() Returns an array of principals for this domain.
|
implies | back to summary |
---|---|
public boolean implies(Permission perm) Check and see if this
The set of permissions evaluated is a function of whether the
If the
Otherwise, the permission will be checked against the combination
of the
|
impliesWithAltFilePerm | back to summary |
---|---|
pack-priv boolean impliesWithAltFilePerm(Permission perm) This method has almost the same logic flow as |
mergePermissions | back to summary |
---|---|
private PermissionCollection mergePermissions() |
seeAllp | back to summary |
---|---|
private static boolean seeAllp() Return
|
staticPermissionsOnly | back to summary |
---|---|
public final boolean staticPermissionsOnly() Returns
|
toString | back to summary |
---|---|
public String toString() Overrides java. Convert a
|
Access | Constructor and Description |
---|---|
private |
debug | back to summary |
---|---|
private static final Debug debug |
DebugHolder | back to summary |
---|---|
private DebugHolder() |
Access | Constructor and Description |
---|---|
private |
JavaSecurityAccessImpl | back to summary |
---|---|
private JavaSecurityAccessImpl() |
doIntersectionPrivilege | back to summary |
---|---|
public <T> T doIntersectionPrivilege(PrivilegedAction<T> action, final AccessControlContext stack, final AccessControlContext context) Implements jdk. Deprecated as a consequence of
|
doIntersectionPrivilege | back to summary |
---|---|
public <T> T doIntersectionPrivilege(PrivilegedAction<T> action, AccessControlContext context) Implements jdk. Deprecated as a consequence of
|
getCombinedACC | back to summary |
---|---|
private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack)
Deprecated as a consequence of
|
getProtectDomains | back to summary |
---|---|
public ProtectionDomain[] getProtectDomains(AccessControlContext context) Implements jdk. Deprecated as a consequence of
|
getProtectionDomainCache | back to summary |
---|---|
public JavaSecurityAccess. Implements jdk. Doc from jdk. Returns the ProtectionDomainCache.
|
Access | Constructor and Description |
---|---|
pack-priv |
Key | back to summary |
---|---|
pack-priv Key() |