java.lang.Object | |
↳ | java.security.ProtectionDomain |
ProtectionDomain
represents all permissions that are granted to a
specific code source. The ClassLoader
associates each class with the
corresponding ProtectionDomain
, depending on the location and the
certificates (encapsulates in CodeSource
) it loads the code from.
A class belongs to exactly one protection domain and the protection domain can not be changed during the lifetime of the class.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
ProtectionDomain with the specified
code source and the specified static permissions. | |||||||||||
Constructs a new instance of
ProtectionDomain with the specified
code source, the permissions, the class loader and the principals. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the
ClassLoader associated with this ProtectionDomain . | |||||||||||
Returns the
CodeSource of this ProtectionDomain . | |||||||||||
Returns the static permissions that are granted to this
ProtectionDomain . | |||||||||||
Returns the principals associated with this
ProtectionDomain . | |||||||||||
Indicates whether the specified permission is implied by this
ProtectionDomain . | |||||||||||
Returns a string containing a concise, human-readable description of the
this
ProtectionDomain . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constructs a new instance of ProtectionDomain
with the specified
code source and the specified static permissions.
If permissions
is not null
, the permissions
collection is made immutable by calling
setReadOnly()
and it is considered as
granted statically to this ProtectionDomain
.
The policy will not be consulted by access checks against this ProtectionDomain
.
If permissions
is null
, the method
implies(Permission)
always returns false
.
cs | the code source associated with this domain, maybe null . |
---|---|
permissions | the PermissionCollection containing all permissions to
be statically granted to this ProtectionDomain , maybe
null . |
Constructs a new instance of ProtectionDomain
with the specified
code source, the permissions, the class loader and the principals.
If permissions
is null
, and access checks are performed
against this protection domain, the permissions defined by the policy are
consulted. If permissions
is not null
, the permissions
collection is made immutable by calling
setReadOnly()
. If access checks are
performed, the policy and the provided permission collection are checked.
External modifications of the provided principals
array has no
impact on this ProtectionDomain
.
cs | the code source associated with this domain, maybe null . |
---|---|
permissions | the permissions associated with this domain, maybe null . |
cl | the class loader associated with this domain, maybe null . |
principals | the principals associated with this domain, maybe null
. |
Returns the ClassLoader
associated with this ProtectionDomain
.
ClassLoader
associated with this ProtectionDomain
, maybe null
.Returns the CodeSource
of this ProtectionDomain
.
CodeSource
of this ProtectionDomain
, maybe
null
.Returns the static permissions that are granted to this ProtectionDomain
.
ProtectionDomain
, maybe null
.Returns the principals associated with this ProtectionDomain
.
Modifications of the returned Principal
array has no impact on
this ProtectionDomain
.
ProtectionDomain
.Indicates whether the specified permission is implied by this ProtectionDomain
.
If this ProtectionDomain
was constructed with
ProtectionDomain(CodeSource, PermissionCollection)
, the
specified permission is only checked against the permission collection
provided in the constructor. If null
was provided, false
is returned.
If this ProtectionDomain
was constructed with
ProtectionDomain(CodeSource, PermissionCollection, ClassLoader, Principal[])
, the specified permission is checked against the policy and the
permission collection provided in the constructor.
permission | the permission to check against the domain. |
---|
true
if the specified permission
is implied by
this ProtectionDomain
, false
otherwise.Returns a string containing a concise, human-readable description of the
this ProtectionDomain
.
ProtectionDomain
.