public final class BasicUntrustedObjectSecurityContext extends Object implements UntrustedObjectSecurityContext
Constructor and Description |
---|
BasicUntrustedObjectSecurityContext(Permission[] permissions)
Constructs an instance with the specified permissions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Returns
true if the specified object and this object
are both instances of this class that were constructed with equivalent
permissions. |
SecurityContext |
getContext()
Returns a security context to use to restrict privileges when
invoking methods on untrusted objects.
|
int |
hashCode()
Returns a hash code value for this object.
|
String |
toString()
Returns a string representation of this object.
|
public BasicUntrustedObjectSecurityContext(Permission[] permissions)
getContext
will be restricted
to the permissions granted by default to all code plus the additional
specified permissions. The argument passed to the constructor is
neither modified nor retained; subsequent changes to that argument
have no effect on the instance created.permissions
- additional permissions to allow, or
null
if no additional permissions should be allowedNullPointerException
- if any element of the argument is
null
public SecurityContext getContext()
Security.getContext
) with an additional
protection domain combined into the access control context that
contains an empty CodeSource
(null
location and
certificates), a permission collection containing the permissions
used to construct this instance, null
class loader, and
null
principals.getContext
in interface UntrustedObjectSecurityContext
public String toString()
public boolean equals(Object obj)
true
if the specified object and this object
are both instances of this class that were constructed with equivalent
permissions. The order of permissions in the array that was passed to
the constructor is not significant.