Additional top-level classes in compilation unit: PermissionsEnumerator, PermissionsHash.
Permission objects,
organized into PermissionCollection objects. For example, if any
java.io.FilePermission objects are added to an instance of
this class, they are all stored in a single PermissionCollection.
It is the PermissionCollection returned by a call to
the newPermissionCollection method in the FilePermission
class. Similarly, any java.lang.RuntimePermission objects are
stored in the PermissionCollection returned by a call to the
newPermissionCollection method in the RuntimePermission
class. Thus, this class represents a collection of
PermissionCollection objects.
When the add method is called to add a Permission, the
Permission is stored in the appropriate PermissionCollection.
If no such collection exists yet, the Permission object's class is
determined and the newPermissionCollection method is called on that
class to create the PermissionCollection and add it to the
Permissions object. If newPermissionCollection returns
null, then a default PermissionCollection that uses a
hashtable will be created and used. Each hashtable entry stores a
Permission object as both the key and the value.
Enumerations returned via the elements method are
not fail-fast. Modifications to a collection should not be
performed while enumerating over that collection.
Permission, PermissionCollection, AllPermission
| Modifier and Type | Field and Description |
|---|---|
| pack-priv PermissionCollection | |
| private transient boolean | |
| private transient ConcurrentHashMap | permsMap
Key is permissions Class, value is |
| private static final ObjectStreamField[] | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(Permission
the permission)Permission object to add.Implements abstract java. Adds a |
| private PermissionCollection | |
| public Enumeration | Returns: an enumeration of all thePermission objects.Implements abstract java. Returns an enumeration of all the |
| private PermissionCollection | getPermissionCollection(Permission p, boolean createEmpty)
Gets the |
| private PermissionCollection | Returns: PermissionCollection containing the unresolved permissions, ornull if there were no unresolved permissions of type p.the type of unresolved permission to resolve p)Resolves any unresolved permissions of type p. |
| public boolean | Returns: true if "permission" is implied by the permissions in the
PermissionCollection it belongs to, false if not.the permission)Permission object to check.Implements abstract java. Checks to see if this object's |
| private void | |
| private void |
| allPermission | back to summary |
|---|---|
| pack-priv PermissionCollection allPermission | |
| hasUnresolved | back to summary |
|---|---|
| private transient boolean hasUnresolved | |
| permsMap | back to summary |
|---|---|
| private transient ConcurrentHashMap<Class<?>, PermissionCollection> permsMap Key is permissions Class, value is | |
| serialPersistentFields | back to summary |
|---|---|
private static final ObjectStreamField[] serialPersistentFields
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| Permissions | back to summary |
|---|---|
| public Permissions() Creates a new | |
| add | back to summary |
|---|---|
| public void add(Permission permission) Implements abstract java. Adds a
| |
| createPermissionCollection | back to summary |
|---|---|
| private PermissionCollection createPermissionCollection(Permission p, boolean createEmpty) | |
| elements | back to summary |
|---|---|
| public Enumeration Implements abstract java. Returns an enumeration of all the
| |
| getPermissionCollection | back to summary |
|---|---|
| private PermissionCollection getPermissionCollection(Permission p, boolean createEmpty) Gets the | |
| getUnresolvedPermissions | back to summary |
|---|---|
| private PermissionCollection getUnresolvedPermissions(Permission p) Resolves any unresolved permissions of type p.
| |
| implies | back to summary |
|---|---|
| public boolean implies(Permission permission) Implements abstract java. Checks to see if this object's For example, suppose there is a Additionally, if this
| |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream out) throws IOException
| |