Additional top-level class in compilation unit: ServicePermissionCollection.
register action allows a bundle to register a service on the
specified names.get action allows a bundle to detect a service and get it.ServicePermission
to get the specific service.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| pack-priv transient int | action_mask
The actions mask. |
| pack-priv static final int | |
| private static final int | |
| private volatile String | actions
The actions in canonical form. |
| pack-priv transient Filter | filter
If this ServicePermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. |
| public static final String | GET
The action string |
| pack-priv final transient String[] | objectClass
The object classes for this ServicePermission. |
| private transient String | prefix
If constructed with a name and the name ends with ".*", this contains the name without the final "*". |
| private transient volatile Map | properties
This map holds the properties of the permission, used to match a filter in implies. |
| public static final String | REGISTER
The action string |
| pack-priv static final long | |
| pack-priv final transient ServiceReference | service
The service used by this ServicePermission. |
| private transient boolean | wildcard
True if constructed with a name and the name is "*" or ends with ".*".
|
| Access | Constructor and Description |
|---|---|
| public | ServicePermission(String
The service class name name, String get,register (canonical order)Create a new ServicePermission. |
| public | ServicePermission(ServiceReference<?>
The requested service. reference, String The action actions)get.Creates a new requested |
| pack-priv | ServicePermission(String
class name name, int action mask mask)Package private constructor used by ServicePermissionCollection. |
| Modifier and Type | Method and Description |
|---|---|
| private static String | Returns: permission name.ServiceReference to use to create permission name. reference)Create a permission name from a ServiceReference |
| public boolean | Returns: true if obj is aServicePermission, and has the same
class name and actions as this ServicePermission object;
false otherwise.The object to test for equality. obj)Overrides java. Determines the equality of two ServicePermission 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 ServicePermission which has already be
validated as a proper argument. The requested ServicePermission
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
ServicePermission 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_GET | back to summary |
|---|---|
| private static final int ACTION_GET | |
| 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_REGISTER | back to summary |
|---|---|
| private static final int ACTION_REGISTER | |
| actions | back to summary |
|---|---|
| private volatile String actions The actions in canonical form. | |
| filter | back to summary |
|---|---|
| pack-priv transient Filter filter If this ServicePermission was constructed with a filter, this holds a Filter matching object used to evaluate the filter in implies. | |
| GET | back to summary |
|---|---|
| public static final String GET The action string | |
| objectClass | back to summary |
|---|---|
| pack-priv final transient String[] objectClass The object classes for this ServicePermission. Must be null if not constructed with a service. | |
| prefix | back to summary |
|---|---|
| private transient String prefix If constructed with a name and the name ends with ".*", this contains the name without the final "*". | |
| 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. | |
| REGISTER | back to summary |
|---|---|
| public static final String REGISTER The action string | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| service | back to summary |
|---|---|
| pack-priv final transient ServiceReference<?> service The service used by this ServicePermission. Must be null if not constructed with a service. | |
| wildcard | back to summary |
|---|---|
| private transient boolean wildcard Hides java. True if constructed with a name and the name is "*" or ends with ".*". | |
| ServicePermission | back to summary |
|---|---|
| public ServicePermission(String name, String actions) Create a new ServicePermission. The name of the service is specified as a fully qualified class name. Wildcards may be used. name ::= <class name> | <class name ending in ".*"> | *Examples: org.osgi.service.http.HttpService org.osgi.service.http.* *For the get action, the name can also be a filter expression. The
filter gives access to the service properties as well as the following
attributes:
There are two possible actions:
| |
| ServicePermission | back to summary |
|---|---|
| public ServicePermission(ServiceReference<?> reference, String actions) Creates a new requested
| |
| ServicePermission | back to summary |
|---|---|
| pack-priv ServicePermission(String name, int mask) Package private constructor used by ServicePermissionCollection.
| |
| createName | back to summary |
|---|---|
| private static String createName(ServiceReference<?> reference) Create a permission name from a ServiceReference
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines the equality of two ServicePermission objects.
Checks that specified object has the same class 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(ServicePermission 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(Filter f, 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 | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private transient volatile Set | |
| private final Map | |
| private final ServiceReference |
| 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 |
| entries | back to summary |
|---|---|
| private transient volatile Set<Map. | |
| properties | back to summary |
|---|---|
| private final Map<String, Object> properties | |
| service | back to summary |
|---|---|
| private final ServiceReference<?> service | |
| Properties | back to summary |
|---|---|
| pack-priv Properties(Map<String, Object> properties, ServiceReference<?> service) | |
| 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
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
object to be compared for equality with this map entry obj)Overrides java. Implements java. Compares the specified object with this entry for equality. |
| public String | |
| public Object | |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this map entry. |
| public Object | setValue(Object
new value to be stored in this entry value)Implements java. Replaces the value corresponding to this entry with the specified value (optional operation). |
| public String |
| Entry | back to summary |
|---|---|
| pack-priv Entry(String key, Object value) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Implements java. Doc from java. Compares the specified object with this entry for equality.
Returns
(e1.getKey()==null ?
e2.getKey()==null : e1.getKey().equals(e2.getKey())) &&
(e1.getValue()==null ?
e2.getValue()==null : e1.getValue().equals(e2.getValue()))
This ensures that the equals method works properly across
different implementations of the Map.Entry interface.
| |
| getKey | back to summary |
|---|---|
| public String getKey() Implements java. Doc from java. Returns the key corresponding to this entry.
| |
| getValue | back to summary |
|---|---|
| public Object getValue() Implements java. Doc from java. Returns the value corresponding to this entry. If the mapping
has been removed from the backing map (by the iterator's
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this map entry. The hash code
of a map entry
(e.getKey()==null ? 0 : e.getKey().hashCode()) ^
(e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that
e1.hashCode()==e2.hashCode() for any two Entries
e1 and e2, as required by the general
contract of Object.hashCode.
| |
| setValue | back to summary |
|---|---|
| public Object setValue(Object value) Implements java. Doc from java. Replaces the value corresponding to this entry with the specified
value (optional operation). (Writes through to the map.) The
behavior of this call is undefined if the mapping has already been
removed from the map (by the iterator's | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |