Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----java.security.Permission | +----java.security.UnresolvedPermission
The policy for a Java runtime (specifying which permissions are available for code from various principals) is represented by a Policy object. Whenever a Policy is initialized or refreshed, Permission objects of appropriate classes are created for all permissions allowed by the Policy.
Many permission class types referenced by the policy configuration are ones that exist locally (i.e., ones that can be found on CLASSPATH). Objects for such permissions can be instantiated during Policy initialization. For example, it is always possible to instantiate a java.io.FilePermission, since the FilePermission class is found on the CLASSPATH.
Other permission classes may not yet exist during Policy initialization. For example, a referenced permission class may be in a JAR file that will later be loaded. For each such class, an UnresolvedPermission is instantiated. Thus, an UnresolvedPermission is essentially a "placeholder" containing information about the permission.
Later, when code calls AccessController.checkPermission on a permission of a type that was previously unresolved, but whose class has since been loaded, previously-unresolved permissions of that type are "resolved". That is, for each such UnresolvedPermission, a new object of the appropriate class type is instantiated, based on the information in the UnresolvedPermission. This new object replaces the UnresolvedPermission, which is removed.
Method Summary | |
boolean | equals(Object obj)
|
String | getActions()
|
int | hashCode()
|
boolean | implies(Permission p)
|
PermissionCollection | newPermissionCollection()
|
String | toString()
|
Methods inherited from class java.security.Permission |
checkGuard, equals, getActions, getName, hashCode, implies, newPermissionCollection, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean implies(Permission p)
p
- the permission to check against.
public boolean equals(Object obj)
obj
- the object we are testing for equality with this object.
public int hashCode()
public String getActions()
public String toString()
public PermissionCollection newPermissionCollection()
Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |