FilePermission objects must be stored in a manner that allows them to be inserted into the collection in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.
For example, if you have two FilePermissions:
"/tmp/-", "read" "/tmp/scratch/foo", "write" and you are calling the implies method with the FilePermission:
"/tmp/scratch/foo", "read,write",then the
implies function must take into account both the "/tmp/-" and "/tmp/scratch/foo" permissions, so the effective permission is "read,write", and implies returns true. The "implies" semantics for FilePermissions are handled properly by the PermissionCollection object returned by this newPermissionCollection method.
@return a new PermissionCollection object suitable for storing FilePermissions.
SocketPermission objects must be stored in a manner that allows them to be inserted into the collection in any order, but that also enables the PermissionCollection implies method to be implemented in an efficient (and consistent) manner.
@return a new PermissionCollection object suitable for storing SocketPermissions.
@return a new PermissionCollection object suitable for storing AllPermissions.
PermissionCollection.implies method is called. If null is returned, then the caller of this method is free to store permissions of this type in any PermissionCollection they choose (one that uses a Hashtable, one that uses a Vector, etc).
@return a new PermissionCollection object for this type of Permission, or null if one is not defined.
@return a new PermissionCollection object suitable for storingPropertyPermissions.
PermissionCollection for storing AuthenticationPermission instances.
@return an empty PermissionCollection for storingAuthenticationPermission instances
GrantPermission instances. The implies method of the returned PermissionCollection instance is defined as follows: for a given GrantPermission g, let c(g) denote the set of all permissions contained within g or within arbitrarily nested GrantPermissions inside g, excluding nested GrantPermissions themselves. Then, a GrantPermission g is implied by the PermissionCollection pc if and only if each permission in c(g) is implied by the union of c(p) for all p in pc. Implication of contained java.security.UnresolvedPermissions is special-cased: an UnresolvedPermission p1 is taken to imply another UnresolvedPermission p2 if and only if the serialized representations of p1 and p2 are identical.
@return newly created empty mutable permission collection forGrantPermissions
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |