org.osgi.framework
public final class BundlePermission extends BasicPermission
A bundle symbolic name defines a unique fully qualified name.
For example:
org.osgi.example.bundle
BundlePermission has four actions: PROVIDE,
REQUIRE,HOST, and FRAGMENT.
The PROVIDE action implies the REQUIRE action.
Since: 1.3
Version: $Revision: 1.16 $
| Field Summary | |
|---|---|
| static String | FRAGMENT
The action string fragment. |
| static String | HOST
The action string host. |
| static String | PROVIDE
The action string provide. |
| static String | REQUIRE
The action string require. |
| Constructor Summary | |
|---|---|
| BundlePermission(String symbolicName, String actions)
Defines the authority to provide and/or require and or specify a host
fragment symbolic name within the OSGi environment.
| |
| Method Summary | |
|---|---|
| boolean | equals(Object obj)
Determines the equality of two BundlePermission objects.
|
| String | getActions()
Returns the canonical string representation of the
BundlePermission actions.
|
| int | hashCode()
Returns the hash code value for this object.
|
| boolean | implies(Permission p)
Determines if the specified permission is implied by this object.
|
| PermissionCollection | newPermissionCollection()
Returns a new PermissionCollection object suitable for
storing BundlePermission objects.
|
fragment.host.provide.require.
Bundle Permissions are granted over all possible versions of a bundle.
A bundle that needs to provide a bundle must have the appropriate
BundlePermission for the symbolic name; a bundle that
requires a bundle must have the appropriate BundlePermssion
for that symbolic name; a bundle that specifies a fragment host must have
the appropriate BundlePermission for that symbolic name.
Parameters: symbolicName the bundle symbolic name. actions PROVIDE,REQUIRE,
HOST,FRAGMENT (canonical order).
BundlePermission objects.
This method checks that specified bundle has the same bundle symbolic
name and BundlePermission actions as this
BundlePermission object.
Parameters: obj The object to test for equality with this
BundlePermission object.
Returns: true if obj is a
BundlePermission, and has the same bundle
symbolic name and actions as this BundlePermission
object; false otherwise.
BundlePermission actions.
Always returns present Returns: Canonical string representation of the BundlePermission actions in the
following order: PROVIDE,REQUIRE,
HOST,FRAGMENT.BundlePermission actions.
Returns: A hash code value for this object.
This method checks that the symbolic name of the target is implied by the
symbolic name of this object. The list of BundlePermission
actions must either match or allow for the list of the target object to
imply the target BundlePermission action.
The permission to provide a bundle implies the permission to require the named symbolic name.
x.y.*,"provide" -> x.y.z,"provide" is true
*,"require" -> x.y, "require" is true
*,"provide" -> x.y, "require" is true
x.y,"provide" -> x.y.z, "provide" is false
Parameters: p The target permission to interrogate.
Returns: true if the specified
BundlePermission action is implied by this object;
false otherwise.
PermissionCollection object suitable for
storing BundlePermission objects.
Returns: A new PermissionCollection object.