类 CapabilityPermission
- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- org.osgi.framework.CapabilityPermission
-
- 所有已实现的接口:
java.io.Serializable,java.security.Guard
public final class CapabilityPermission extends java.security.BasicPermissionA bundle's authority to provide or require a capability.- The
provideaction allows a bundle to provide a capability matching the specified filter. - The
requireaction allows a bundle to require a capability matching the specified filter.
- 从以下版本开始:
- 1.6
- 作者:
- $Id: 1d8e892cf46d7410cd3fdff1f5ca2fb010a33ae6 $
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 CapabilityPermission(java.lang.String name, java.lang.String actions)Create a new CapabilityPermission.CapabilityPermission(java.lang.String namespace, java.util.Map<java.lang.String,?> attributes, Bundle providingBundle, java.lang.String actions)Creates a new requestedCapabilityPermissionobject to be used by code that must performcheckPermissionfor therequireaction.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object obj)Determines the equality of two CapabilityPermission objects.java.lang.StringgetActions()Returns the canonical string representation of the actions.inthashCode()Returns the hash code value for this object.booleanimplies(java.security.Permission p)Determines if aCapabilityPermissionobject "implies" the specified permission.java.security.PermissionCollectionnewPermissionCollection()Returns a newPermissionCollectionobject for storingCapabilityPermissionobjects.
-
-
-
构造器详细资料
-
CapabilityPermission
public CapabilityPermission(java.lang.String name, java.lang.String actions)Create a new CapabilityPermission.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 therequireaction, the name can also be a filter expression. The filter gives access to the capability attributes as well as the following attributes:- signer - A Distinguished Name chain used to sign the bundle providing the capability. Wildcards in a DN are not matched according to the filter string rules, but according to the rules defined for a DN chain.
- location - The location of the bundle providing the capability.
- id - The bundle ID of the bundle providing the capability.
- name - The symbolic name of the bundle providing the capability.
- capability.namespace - The namespace of the required capability.
There are two possible actions:
requireandprovide. Therequirepermission allows the owner of this permission to require a capability matching the attributes. Theprovidepermission allows the bundle to provide a capability in the specified capability namespace.- 参数:
name- The capability namespace 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 notrequireor the filter has an invalid syntax.
-
CapabilityPermission
public CapabilityPermission(java.lang.String namespace, java.util.Map<java.lang.String,?> attributes, Bundle providingBundle, java.lang.String actions)Creates a new requestedCapabilityPermissionobject to be used by code that must performcheckPermissionfor therequireaction.CapabilityPermissionobjects created with this constructor cannot be added to aCapabilityPermissionpermission collection.- 参数:
namespace- The requested capability namespace.attributes- The requested capability attributes.providingBundle- The bundle providing the requested capability.actions- The actionrequire.- 抛出:
java.lang.IllegalArgumentException- If the specified action is notrequireor attributes or providingBundle arenull.
-
-
方法详细资料
-
implies
public boolean implies(java.security.Permission p)
Determines if aCapabilityPermissionobject "implies" the specified permission.- 覆盖:
implies在类中java.security.BasicPermission- 参数:
p- The target permission to check.- 返回:
trueif the specified permission is implied by this object;falseotherwise.
-
getActions
public java.lang.String getActions()
Returns the canonical string representation of the actions. Always returns present actions in the following order:require,provide.- 覆盖:
getActions在类中java.security.BasicPermission- 返回:
- The canonical string representation of the actions.
-
newPermissionCollection
public java.security.PermissionCollection newPermissionCollection()
Returns a newPermissionCollectionobject for storingCapabilityPermissionobjects.- 覆盖:
newPermissionCollection在类中java.security.BasicPermission- 返回:
- A new
PermissionCollectionobject suitable for storingCapabilityPermissionobjects.
-
equals
public boolean equals(java.lang.Object obj)
Determines the equality of two CapabilityPermission objects. Checks that specified object has the same name and action as thisCapabilityPermission.- 覆盖:
equals在类中java.security.BasicPermission- 参数:
obj- The object to test for equality.- 返回:
- true if obj is a
CapabilityPermission, and has the same name and actions as thisCapabilityPermissionobject;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code value for this object.- 覆盖:
hashCode在类中java.security.BasicPermission- 返回:
- Hash code value for this object.
-
-