GigaSpaces XAP 9.7.2 API

net.jini.security.proxytrust
Class BasicUntrustedObjectSecurityContext

java.lang.Object
  extended by net.jini.security.proxytrust.BasicUntrustedObjectSecurityContext
All Implemented Interfaces:
UntrustedObjectSecurityContext

public final class BasicUntrustedObjectSecurityContext
extends Object
implements UntrustedObjectSecurityContext

A basic trust verifier context element that provides a security context to use to restrict privileges when invoking methods on untrusted objects, based on a specified set of permissions.

Since:
2.1
Author:
Sun Microsystems, Inc.

Constructor Summary
BasicUntrustedObjectSecurityContext(Permission[] permissions)
          Constructs an instance with the specified permissions.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicUntrustedObjectSecurityContext

public BasicUntrustedObjectSecurityContext(Permission[] permissions)
Constructs an instance with the specified permissions. The security context returned by 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.

Parameters:
permissions - additional permissions to allow, or null if no additional permissions should be allowed
Throws:
NullPointerException - if any element of the argument is null
Method Detail

getContext

public SecurityContext getContext()
Returns a security context to use to restrict privileges when invoking methods on untrusted objects. The returned context is equivalent to the current security context (as returned by 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.

Specified by:
getContext in interface UntrustedObjectSecurityContext
Returns:
a security context to use to restrict privileges when invoking methods on untrusted objects

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object

equals

public 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. The order of permissions in the array that was passed to the constructor is not significant.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this object.

Overrides:
hashCode in class Object

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.