|
OSGi™ Service Platform Core Specification Release 4 Version 4.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.Permission java.security.BasicPermission org.osgi.framework.CapabilityPermission
public final class CapabilityPermission
A bundle's authority to provide or require a capability.
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.
Field Summary | |
---|---|
static java.lang.String |
PROVIDE
The action string provide . |
static java.lang.String |
REQUIRE
The action string require . |
Constructor Summary | |
---|---|
CapabilityPermission(java.lang.String namespace,
java.util.Map<java.lang.String,?> attributes,
Bundle providingBundle,
java.lang.String actions)
Creates a new requested CapabilityPermission object to be used by
code that must perform checkPermission for the require
action. |
|
CapabilityPermission(java.lang.String name,
java.lang.String actions)
Create a new CapabilityPermission. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determines the equality of two CapabilityPermission objects. |
java.lang.String |
getActions()
Returns the canonical string representation of the actions. |
int |
hashCode()
Returns the hash code value for this object. |
boolean |
implies(java.security.Permission p)
Determines if a CapabilityPermission object "implies" the
specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing
CapabilityPermission objects. |
Methods inherited from class java.security.Permission |
---|
checkGuard, getName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String REQUIRE
require
.
public static final java.lang.String PROVIDE
provide
.
Constructor Detail |
---|
public CapabilityPermission(java.lang.String name, java.lang.String actions)
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: require
and provide
. The
require
permission allows the owner of this permission to require
a capability matching the attributes. The provide
permission
allows the bundle to provide a capability in the specified capability
name space.
name
- The capability name space or a filter over the attributes.actions
- require
,provide
(canonical order)
java.lang.IllegalArgumentException
- If the specified name is a filter
expression and either the specified action is not require
or the filter has an invalid syntax.public CapabilityPermission(java.lang.String namespace, java.util.Map<java.lang.String,?> attributes, Bundle providingBundle, java.lang.String actions)
CapabilityPermission
object to be used by
code that must perform checkPermission
for the require
action. CapabilityPermission
objects created with this
constructor cannot be added to a CapabilityPermission
permission
collection.
namespace
- The requested capability name space.attributes
- The requested capability attributes.providingBundle
- The bundle providing the requested capability.actions
- The action require
.
java.lang.IllegalArgumentException
- If the specified action is not
require
or attributes or providingBundle are null
.Method Detail |
---|
public boolean implies(java.security.Permission p)
CapabilityPermission
object "implies" the
specified permission.
implies
in class java.security.BasicPermission
p
- The target permission to check.
true
if the specified permission is implied by this
object; false
otherwise.public java.lang.String getActions()
require
,
provide
.
getActions
in class java.security.BasicPermission
public java.security.PermissionCollection newPermissionCollection()
PermissionCollection
object for storing
CapabilityPermission
objects.
newPermissionCollection
in class java.security.Permission
PermissionCollection
object suitable for storing
CapabilityPermission
objects.public boolean equals(java.lang.Object obj)
CapabilityPermission
.
equals
in class java.security.BasicPermission
obj
- The object to test for equality.
CapabilityPermission
, and has the same
name and actions as this CapabilityPermission
object;
false
otherwise.public int hashCode()
hashCode
in class java.security.BasicPermission
|
OSGi™ Service Platform Core Specification Release 4 Version 4.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |