Additional top-level class in compilation unit: CapabilityPermissionCollection.
provide action allows a bundle to provide a capability
matching the specified filter.require action allows a bundle to require a capability
matching the specified filter.| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| pack-priv transient int | action_mask
The actions mask. |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private volatile String | actions
The actions in canonical form. |
| pack-priv final transient Map | attributes
The attributes of the requested capability. |
| pack-priv final transient Bundle | bundle
The bundle of the requested capability. |
| pack-priv transient Filter | filter
If this CapabilityPermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. |
| private transient volatile Map | properties
This map holds the properties of the permission, used to match a filter in implies. |
| public static final String | PROVIDE
The action string |
| public static final String | REQUIRE
The action string |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public | CapabilityPermission(String
The capability namespace or a filter over the attributes. name, String require,provide (canonical order)Create a new CapabilityPermission. |
| public | CapabilityPermission(String
The requested capability namespace. namespace, Map<String, ?> The requested capability attributes. attributes, Bundle The bundle providing the requested capability. providingBundle, String The action actions)require.Creates a new requested |
| pack-priv | CapabilityPermission(String
class name name, int action mask mask)Package private constructor used by CapabilityPermissionCollection. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if obj is aCapabilityPermission, and has the same
name and actions as this CapabilityPermission object;
false otherwise.The object to test for equality. obj)Overrides java. Determines the equality of two CapabilityPermission objects. |
| public String | Returns: The canonical string representation of the actions.Overrides java. Returns the canonical string representation of the actions. |
| private Map | Returns: a map of properties for this permission.Called by |
| public int | Returns: Hash code value for this object.Overrides java. Returns the hash code value for this object. |
| public boolean | Returns: true if the specified permission is implied by this
object; false otherwise.The target permission to check. p)Overrides java. Determines if a |
| pack-priv boolean | Returns: true if the specified permission is implied by this
object; false otherwise.The requested CapabilityPermission which has already be
validated as a proper argument. The requested CapabilityPermission
must not have a filter expression. requested, int The effective actions with which to start. effective)Internal implies method. |
| public PermissionCollection | Returns: A newPermissionCollection object suitable for storing
CapabilityPermission objects.Overrides java. Returns a new |
| private static int | Returns: action mask.Action string. actions)Parse action string into action mask. |
| private static Filter | Returns: a Filter for this bundle. If the specified filterString is not a filter expression, thennull is returned.The filter string to parse. filterString)Parse filter string into a Filter object. |
| private synchronized void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readHides java. readObject is called to restore the state of this permission from a stream. |
| private void | |
| private synchronized void | writeObject(ObjectOutputStream s)
WriteObject is called to save the state of this permission to a stream. |
| ACTION_ALL | back to summary |
|---|---|
| private static final int ACTION_ALL | |
| action_mask | back to summary |
|---|---|
| pack-priv transient int action_mask The actions mask. | |
| ACTION_NONE | back to summary |
|---|---|
| pack-priv static final int ACTION_NONE | |
| ACTION_PROVIDE | back to summary |
|---|---|
| private static final int ACTION_PROVIDE | |
| ACTION_REQUIRE | back to summary |
|---|---|
| private static final int ACTION_REQUIRE | |
| actions | back to summary |
|---|---|
| private volatile String actions The actions in canonical form. | |
| attributes | back to summary |
|---|---|
| pack-priv final transient Map<String, Object> attributes The attributes of the requested capability. Must be null if not constructed with attributes. | |
| bundle | back to summary |
|---|---|
| pack-priv final transient Bundle bundle The bundle of the requested capability. Must be null if not constructed with bundle. | |
| filter | back to summary |
|---|---|
| pack-priv transient Filter filter If this CapabilityPermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. | |
| properties | back to summary |
|---|---|
| private transient volatile Map<String, Object> properties This map holds the properties of the permission, used to match a filter in implies. This is not initialized until necessary, and then cached in this object. | |
| PROVIDE | back to summary |
|---|---|
| public static final String PROVIDE The action string | |
| REQUIRE | back to summary |
|---|---|
| public static final String REQUIRE The action string | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| CapabilityPermission | back to summary |
|---|---|
| public CapabilityPermission(String name, String actions) Create a new CapabilityPermission. The name is specified as a dot-separated string. Wildcards may be used. name ::= <namespace> | <namespace ending in ".*"> | *Examples: com.acme.capability.* org.foo.capability *For the require action, the name can also be a filter expression.
The filter gives access to the capability attributes as well as the
following attributes:
There are two possible actions:
| |
| CapabilityPermission | back to summary |
|---|---|
| public CapabilityPermission(String namespace, Map<String, ?> attributes, Bundle providingBundle, String actions) Creates a new requested
| |
| CapabilityPermission | back to summary |
|---|---|
| pack-priv CapabilityPermission(String name, int mask) Package private constructor used by CapabilityPermissionCollection.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines the equality of two CapabilityPermission objects.
Checks that specified object has the same name and action as this
| |
| getActions | back to summary |
|---|---|
| public String getActions() Overrides java. Returns the canonical string representation of the actions. Always
returns present actions in the following order: | |
| getProperties | back to summary |
|---|---|
| private Map Called by | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code value for this object.
| |
| implies | back to summary |
|---|---|
| public boolean implies(Permission p) Overrides java. Determines if a
| |
| implies0 | back to summary |
|---|---|
| pack-priv boolean implies0(CapabilityPermission requested, int effective) Internal implies method. Used by the implies and the permission collection implies methods.
| |
| newPermissionCollection | back to summary |
|---|---|
| public PermissionCollection newPermissionCollection() Overrides java. Returns a new
| |
| parseActions | back to summary |
|---|---|
| private static int parseActions(String actions) Parse action string into action mask.
| |
| parseFilter | back to summary |
|---|---|
| private static Filter parseFilter(String filterString) Parse filter string into a Filter object.
| |
| readObject | back to summary |
|---|---|
| private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides java. readObject is called to restore the state of this permission from a stream.
| |
| setTransients | back to summary |
|---|---|
| private void setTransients(String name, int mask) Called by constructors and when deserialized.
| |
| writeObject | back to summary |
|---|---|
| private synchronized void writeObject(ObjectOutputStream s) throws IOException WriteObject is called to save the state of this permission to a stream. The actions are serialized, and the superclass takes care of the name. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private transient volatile Set | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Set | entrySet()
Implements abstract java. Implements java. Returns a |
| public Object | get(Object
the key whose associated value is to be returned k)Overrides java. Implements java. Returns the value to which the specified key is mapped,
or |
| attributes | back to summary |
|---|---|
| private final Map<String, Object> attributes | |
| entries | back to summary |
|---|---|
| private transient volatile Set<Map. | |
| properties | back to summary |
|---|---|
| private final Map<String, Object> properties | |
| Properties | back to summary |
|---|---|
| pack-priv Properties(Map<String, Object> properties, Map<String, Object> attributes) | |
| entrySet | back to summary |
|---|---|
| public Set Implements abstract java. Implements java. Doc from java. Returns a | |
| get | back to summary |
|---|---|
| public Object get(Object k) Overrides java. Implements java. Doc from java. Returns the value to which the specified key is mapped,
or More formally, if this map contains a mapping from a key
If this map permits null values, then a return value of
| |