Class BundlePermission
- All Implemented Interfaces:
Serializable
,Guard
A bundle symbolic name defines a unique fully qualified name. Wildcards may be used.
name ::= <symbolic name> | <symbolic name ending in ".*"> | *Examples:
org.osgi.example.bundle org.osgi.example.* *
BundlePermission
has four actions: provide
, require
,
host
, and fragment
. The provide
action implies the
require
action.
- Since:
- 1.3
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBundlePermission
(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
Modifier and TypeMethodDescriptionboolean
Determines the equality of twoBundlePermission
objects.Returns the canonical string representation of theBundlePermission
actions.int
hashCode()
Returns the hash code value for this object.boolean
Determines if the specified permission is implied by this object.Returns a newPermissionCollection
object suitable for storingBundlePermission
objects.Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
Field Details
-
PROVIDE
The action stringprovide
. Theprovide
action implies therequire
action.- See Also:
-
REQUIRE
The action stringrequire
. Therequire
action is implied by theprovide
action.- See Also:
-
HOST
The action stringhost
.- See Also:
-
FRAGMENT
The action stringfragment
.- See Also:
-
-
Constructor Details
-
BundlePermission
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 appropriateBundlePermssion
for that symbolic name; a bundle that specifies a fragment host must have the appropriateBundlePermission
for that symbolic name.- Parameters:
symbolicName
- The bundle symbolic name.actions
-provide
,require
,host
,fragment
(canonical order).
-
-
Method Details
-
implies
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 targetBundlePermission
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
- Overrides:
implies
in classBasicPermission
- Parameters:
p
- The requested permission.- Returns:
true
if the specifiedBundlePermission
action is implied by this object;false
otherwise.
-
getActions
Returns the canonical string representation of theBundlePermission
actions.Always returns present
BundlePermission
actions in the following order:provide
,require
,host
,fragment
.- Overrides:
getActions
in classBasicPermission
- Returns:
- Canonical string representation of the
BundlePermission
actions.
-
newPermissionCollection
Returns a newPermissionCollection
object suitable for storingBundlePermission
objects.- Overrides:
newPermissionCollection
in classBasicPermission
- Returns:
- A new
PermissionCollection
object.
-
equals
Determines the equality of twoBundlePermission
objects. This method checks that specified bundle has the same bundle symbolic name andBundlePermission
actions as thisBundlePermission
object.- Overrides:
equals
in classBasicPermission
- Parameters:
obj
- The object to test for equality with thisBundlePermission
object.- Returns:
true
ifobj
is aBundlePermission
, and has the same bundle symbolic name and actions as thisBundlePermission
object;false
otherwise.
-
hashCode
public int hashCode()Returns the hash code value for this object.- Overrides:
hashCode
in classBasicPermission
- Returns:
- A hash code value for this object.
-