Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class ProtectionDomain

java.lang.Object
|
+--java.security.ProtectionDomain


public class ProtectionDomain

extends 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:

Constructor Summary

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.

Method Summary

java.security.CodeSourcegetCodeSource()

This method returns the CodeSource for this domain.
java.security.PermissionCollectiongetPermissions()

This method returns the set of permissions granted to this domain.
booleanimplies(java.security.Permission perm)

This method tests whether or not the specified Permission is implied by the set of permissions granted to this domain.
java.lang.StringtoString()

This method returns a String representation of this object.

Constructor Details

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:


Method Details

getCodeSource

public final CodeSource getCodeSource()

This method returns the CodeSource for this domain.

Returns:


getPermissions

public final PermissionCollection getPermissions()

This method returns the set of permissions granted to this domain.

Returns:


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:


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: