java.lang.Object | |
↳ | java.security.AccessControlContext |
AccessControlContext
encapsulates the ProtectionDomain
s on
which access control decisions are based.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
AccessControlContext with the
specified AccessControlContext and DomainCombiner . | |||||||||||
Constructs a new instance of
AccessControlContext with the
specified array of ProtectionDomain s. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks the specified permission against the vm's current security policy.
| |||||||||||
Compares the specified object with this
AccessControlContext for
equality. | |||||||||||
Returns the
DomainCombiner associated with this AccessControlContext . | |||||||||||
Returns the hash code value for this
AccessControlContext . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a new instance of AccessControlContext
with the
specified AccessControlContext
and DomainCombiner
.
If a SecurityManager
is installed, code calling this constructor
need the SecurityPermission
createAccessControlContext
to
be granted, otherwise a SecurityException
will be thrown.
acc | the AccessControlContext related to the given DomainCombiner |
---|---|
combiner | the DomainCombiner related to the given AccessControlContext |
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this constructor |
---|---|
NullPointerException | if acc is null
|
Constructs a new instance of AccessControlContext
with the
specified array of ProtectionDomain
s.
context | the ProtectionDomain s that are used to perform access
checks in the context of this AccessControlContext |
---|
NullPointerException | if context is null
|
---|
Checks the specified permission against the vm's current security policy.
The check is based on this AccessControlContext
as opposed to the
checkPermission(Permission)
method which
performs access checks based on the context of the current thread. This
method returns silently if the permission is granted, otherwise an
AccessControlException
is thrown.
A permission is considered granted if every ProtectionDomain
in
this context has been granted the specified permission.
If privileged operations are on the call stack, only the ProtectionDomain
s from the last privileged operation are taken into
account.
If inherited methods are on the call stack, the protection domains of the declaring classes are checked, not the protection domains of the classes on which the method is invoked.
perm | the permission to check against the policy |
---|
AccessControlException | if the specified permission is not granted |
---|---|
NullPointerException | if the specified permission is null |
Compares the specified object with this AccessControlContext
for
equality. Returns true
if the specified object is also an
instance of AccessControlContext
, and the two contexts
encapsulate the same ProtectionDomain
s. The order of the ProtectionDomain
s is ignored by this method.
obj | object to be compared for equality with this AccessControlContext |
---|
true
if the specified object is equal to this AccessControlContext
, otherwise false
Returns the DomainCombiner
associated with this AccessControlContext
.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
getDomainCombiner
to be granted,
otherwise a SecurityException
will be thrown.
DomainCombiner
associated with this AccessControlContext
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method
|
---|
Returns the hash code value for this AccessControlContext
.
Returns the same hash code for AccessControlContext
s that are
equal to each other as required by the general contract of
hashCode()
.
AccessControlContext