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.
Definition at line 49 of file BundlePermission.java.
Public Member Functions | |
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. | |
boolean | implies (Permission p) |
Determines if the specified permission is implied by this object. | |
String | getActions () |
Returns the canonical string representation of the BundlePermission actions. | |
PermissionCollection | newPermissionCollection () |
Returns a new PermissionCollection object suitable for storing BundlePermission objects. | |
boolean | equals (Object obj) |
Determines the equality of two BundlePermission objects. | |
int | hashCode () |
Returns the hash code value for this object. | |
Static Public Attributes | |
static final String | PROVIDE = "provide" |
The action string provide . | |
static final String | REQUIRE = "require" |
The action string require . | |
static final String | HOST = "host" |
The action string host . | |
static final String | FRAGMENT = "fragment" |
The action string fragment . | |
Package Functions | |
BundlePermission (String symbolicName, int mask) | |
Bundle private constructor used by BundlePermissionCollection. | |
int | getMask () |
Returns the current action mask. |
org.osgi.framework.BundlePermission.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.
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.
symbolicName | the bundle symbolic name. | |
actions | PROVIDE ,REQUIRE , HOST ,FRAGMENT (canonical order). |
Definition at line 111 of file BundlePermission.java.
References org.osgi.framework.BundlePermission.getMask().
org.osgi.framework.BundlePermission.BundlePermission | ( | String | symbolicName, | |
int | mask | |||
) | [package] |
Bundle private constructor used by BundlePermissionCollection.
symbolicName | the bundle symbolic name | |
mask | the action mask |
Definition at line 121 of file BundlePermission.java.
boolean org.osgi.framework.BundlePermission.implies | ( | Permission | p | ) |
Determines if the specified permission is implied by 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
p | The target permission to interrogate. |
true
if the specified BundlePermission
action is implied by this object; false
otherwise. Definition at line 276 of file BundlePermission.java.
References org.osgi.framework.BundlePermission.action_mask.
String org.osgi.framework.BundlePermission.getActions | ( | ) |
Returns the canonical string representation of the BundlePermission
actions.
Always returns present BundlePermission
actions in the following order: PROVIDE
,REQUIRE
, HOST
,FRAGMENT.
BundlePermission
actions.
Definition at line 298 of file BundlePermission.java.
References org.osgi.framework.BundlePermission.FRAGMENT, org.osgi.framework.BundlePermission.HOST, org.osgi.framework.BundlePermission.PROVIDE, and org.osgi.framework.BundlePermission.REQUIRE.
Referenced by org.osgi.framework.BundlePermission.hashCode().
PermissionCollection org.osgi.framework.BundlePermission.newPermissionCollection | ( | ) |
Returns a new PermissionCollection
object suitable for storing BundlePermission
objects.
PermissionCollection
object. Definition at line 340 of file BundlePermission.java.
boolean org.osgi.framework.BundlePermission.equals | ( | Object | obj | ) |
Determines the equality of two BundlePermission
objects.
This method checks that specified bundle has the same bundle symbolic name and BundlePermission
actions as this BundlePermission
object.
obj | The object to test for equality with this BundlePermission object. |
true
if obj
is a BundlePermission
, and has the same bundle symbolic name and actions as this BundlePermission
object; false
otherwise. Definition at line 358 of file BundlePermission.java.
References org.osgi.framework.BundlePermission.action_mask.
int org.osgi.framework.BundlePermission.hashCode | ( | ) |
Returns the hash code value for this object.
Definition at line 378 of file BundlePermission.java.
References org.osgi.framework.BundlePermission.getActions().
int org.osgi.framework.BundlePermission.getMask | ( | ) | [package] |
Returns the current action mask.
Used by the BundlePermissionCollection class.
Definition at line 389 of file BundlePermission.java.
Referenced by org.osgi.framework.BundlePermission.BundlePermission().