java.security
Class UnresolvedPermission

java.lang.Object
  extended by java.security.Permission
      extended by java.security.UnresolvedPermission
All Implemented Interfaces:
Serializable, Guard

public final class UnresolvedPermission
extends Permission

This class is used to hold instances of all permissions that cannot be resolved to available permission classes when the security Policy object is instantiated. This may happen when the necessary security class has not yet been downloaded from the network.

Instances of this class are re-resolved when AccessController check is done. At that time, a scan is made of all existing UnresolvedPermission objects and they are converted to objects of the appropriate permission type if the class for that type is then available.

Since:
1.1
See Also:
Permission, Permissions, PermissionCollection, Policy, Serialized Form

Constructor Summary
UnresolvedPermission(String type, String name, String actions, Certificate[] certs)
          Create a new instance with all the information necessary to resolve it to an instance of the proper class at a future time.
 
Method Summary
 boolean equals(Object obj)
          This method tests this permission for equality against the specified Object.
 String getActions()
          This method returns the list of actions associated with this permission.
 String getUnresolvedActions()
          Return the actions of the unresolved permission, or null if there are no actions.
 Certificate[] getUnresolvedCerts()
          Return the certificates of the unresolved permission.
 String getUnresolvedName()
          Return the name of the unresolved permission.
 String getUnresolvedType()
          Return the name of the class of the unresolved permission.
 int hashCode()
          Returns a hash code value for this object.
 boolean implies(Permission perm)
          This method returns false always to indicate that this permission does not imply the specified permission.
 PermissionCollection newPermissionCollection()
          This class returns a PermissionCollection object that can be used to store instances of UnresolvedPermission.
 String toString()
          This method returns a String representation of this class.
 
Methods inherited from class java.security.Permission
checkGuard, getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnresolvedPermission

public UnresolvedPermission(String type,
                            String name,
                            String actions,
                            Certificate[] certs)
Create a new instance with all the information necessary to resolve it to an instance of the proper class at a future time.

Parameters:
type - the fully-qualified name of the class of this permission
name - the name of this permission
actions - the action list for this permission
certs - the list of certificates that sign this permission
Method Detail

implies

public boolean implies(Permission perm)
This method returns false always to indicate that this permission does not imply the specified permission. An UnresolvedPermission never grants any permissions.

Specified by:
implies in class Permission
Parameters:
perm - the Permission object to test
Returns:
false; until a permission is resolved, it implies nothing

equals

public boolean equals(Object obj)
This method tests this permission for equality against the specified Object. This will be true if and only if the following conditions are met:

Specified by:
equals in class Permission
Parameters:
obj - the Object to test for equality
Returns:
true if the specified object is equal to this one
See Also:
Object.hashCode()

hashCode

public int hashCode()
Returns a hash code value for this object. Following the lead of Permission, this returns the hashcode of the permission name.

Specified by:
hashCode in class Permission
Returns:
A hash value
See Also:
Object.equals(Object), System.identityHashCode(Object)

getActions

public String getActions()
This method returns the list of actions associated with this permission.

Specified by:
getActions in class Permission
Returns:
the action list

toString

public String toString()
This method returns a String representation of this class. The format is: '(unresolved "ClassName "name" "actions")'

Overrides:
toString in class Permission
Returns:
String representation of this object
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)

newPermissionCollection

public PermissionCollection newPermissionCollection()
This class returns a PermissionCollection object that can be used to store instances of UnresolvedPermission.

Overrides:
newPermissionCollection in class Permission
Returns:
a new PermissionCollection

getUnresolvedType

public String getUnresolvedType()
Return the name of the class of the unresolved permission.

Since:
1.5

getUnresolvedName

public String getUnresolvedName()
Return the name of the unresolved permission.

Since:
1.5

getUnresolvedActions

public String getUnresolvedActions()
Return the actions of the unresolved permission, or null if there are no actions.

Since:
1.5

getUnresolvedCerts

public Certificate[] getUnresolvedCerts()
Return the certificates of the unresolved permission. If there are no certificates, null is returned. Otherwise, a new array is returned.

Since:
1.5