java.security
Class ProtectionDomain
java.lang.Object
|
+--java.security.ProtectionDomain
public class
ProtectionDomainextends
Object This class represents a group of classes, along with the permissions
they are granted. The classes are identified by a
CodeSource.
Thus, any class loaded from the specified
CodeSource is
treated as part of this domain. The set of permissions is represented
by a
PermissionCollection.
Every class in the system will belong to one and only one
ProtectionDomain.
Author:- Aaron M. Renn (arenn@urbanophile.com)
ProtectionDomain
public ProtectionDomain(java.security.CodeSource code_source, java.security.PermissionCollection perms) This method initializes a new instance of ProtectionDomain
representing the specified CodeSource and permission set.
No permissions may be added to the PermissionCollection
and this contructor will call the setReadOnly method on
the specified permission set.
Parameters:
See Also:
getCodeSource
public final CodeSource getCodeSource() This method returns the CodeSource for this domain.
Returns:
- This domain's
CodeSource.
getPermissions
public final PermissionCollection getPermissions() This method returns the set of permissions granted to this domain.
Returns:
- The permission set for this domain
implies
public boolean implies(java.security.Permission perm) This method tests whether or not the specified Permission is
implied by the set of permissions granted to this domain.
Parameters:
Returns:
true if the specified Permission is implied for this domain, false otherwise.
toString
public String toString() This method returns a String representation of this
object. It will print the CodeSource and
permission set associated with this domain.
Returns:
- A
String representation of this object.
CodeSource. Thus, any class loaded from the specifiedCodeSourceis treated as part of this domain. The set of permissions is represented by aPermissionCollection.Every class in the system will belong to one and only one
ProtectionDomain.