58 * <p>When the {@code add} method is called to add a Permission, the
59 * Permission is stored in the appropriate PermissionCollection. If no such
60 * collection exists yet, the Permission object's class is determined and the
61 * {@code newPermissionCollection} method is called on that class to create
62 * the PermissionCollection and add it to the Permissions object. If
63 * {@code newPermissionCollection} returns null, then a default
64 * PermissionCollection that uses a hashtable will be created and used. Each
65 * hashtable entry stores a Permission object as both the key and the value.
66 *
67 * <p> Enumerations returned via the {@code elements} method are
68 * not <em>fail-fast</em>. Modifications to a collection should not be
69 * performed while enumerating over that collection.
70 *
71 * @see Permission
72 * @see PermissionCollection
73 * @see AllPermission
74 *
75 *
76 * @author Marianne Mueller
77 * @author Roland Schemers
78 *
79 * @serial exclude
80 */
81
82 public final class Permissions extends PermissionCollection
83 implements Serializable
84 {
85 /**
86 * Key is permissions Class, value is PermissionCollection for that class.
87 * Not serialized; see serialization section at end of class.
88 */
89 private transient ConcurrentHashMap<Class<?>, PermissionCollection> permsMap;
90
91 // optimization. keep track of whether unresolved permissions need to be
92 // checked
93 private transient boolean hasUnresolved = false;
94
95 // optimization. keep track of the AllPermission collection
96 // - package private for ProtectionDomain optimization
97 PermissionCollection allPermission;
|
58 * <p>When the {@code add} method is called to add a Permission, the
59 * Permission is stored in the appropriate PermissionCollection. If no such
60 * collection exists yet, the Permission object's class is determined and the
61 * {@code newPermissionCollection} method is called on that class to create
62 * the PermissionCollection and add it to the Permissions object. If
63 * {@code newPermissionCollection} returns null, then a default
64 * PermissionCollection that uses a hashtable will be created and used. Each
65 * hashtable entry stores a Permission object as both the key and the value.
66 *
67 * <p> Enumerations returned via the {@code elements} method are
68 * not <em>fail-fast</em>. Modifications to a collection should not be
69 * performed while enumerating over that collection.
70 *
71 * @see Permission
72 * @see PermissionCollection
73 * @see AllPermission
74 *
75 *
76 * @author Marianne Mueller
77 * @author Roland Schemers
78 * @since 1.2
79 *
80 * @serial exclude
81 */
82
83 public final class Permissions extends PermissionCollection
84 implements Serializable
85 {
86 /**
87 * Key is permissions Class, value is PermissionCollection for that class.
88 * Not serialized; see serialization section at end of class.
89 */
90 private transient ConcurrentHashMap<Class<?>, PermissionCollection> permsMap;
91
92 // optimization. keep track of whether unresolved permissions need to be
93 // checked
94 private transient boolean hasUnresolved = false;
95
96 // optimization. keep track of the AllPermission collection
97 // - package private for ProtectionDomain optimization
98 PermissionCollection allPermission;
|