java.security

Class UnresolvedPermission

Implemented Interfaces:
Guard, Serializable

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, equals, getActions, getName, hashCode, implies, newPermissionCollection, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

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 Details

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:
  • The specified Object is an UnresolvedPermission
  • The specified permission has the same type (i.e., desired class name) as this permission.
  • The specified permission has the same name as this one.
  • The specified permissoin has the same action list as this one.
  • The specified permission has the same certificate list as this one.
Overrides:
equals in interface Permission
Parameters:
obj - the Object to test for equality
Returns:
true if the specified object is equal to this one

getActions

public String getActions()
This method returns the list of actions associated with this permission.
Overrides:
getActions in interface Permission
Returns:
the action list

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

getUnresolvedName

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

getUnresolvedType

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

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.
Overrides:
hashCode in interface Permission
Returns:
A hash value

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.
Overrides:
implies in interface Permission
Parameters:
perm - the Permission object to test
Returns:
false; until a permission is resolved, it implies nothing

newPermissionCollection

public PermissionCollection newPermissionCollection()
This class returns a PermissionCollection object that can be used to store instances of UnresolvedPermission.
Overrides:
newPermissionCollection in interface Permission
Returns:
a new PermissionCollection

toString

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

UnresolvedPermission.java -- Placeholder for unresolved permissions Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.