|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
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.ServicePermission
public final class ServicePermission
A bundle's authority to register or get a service.
register
action allows a bundle to register a service on
the specified names.
get
action allows a bundle to detect a service and get
it.
ServicePermission
to get the specific service.
Field Summary | |
---|---|
static java.lang.String |
GET
The action string get . |
static java.lang.String |
REGISTER
The action string register . |
Constructor Summary | |
---|---|
ServicePermission(ServiceReference reference,
java.lang.String actions)
Creates a new requested ServicePermission object to be used
by code that must perform checkPermission for the
get action. |
|
ServicePermission(java.lang.String name,
java.lang.String actions)
Create a new ServicePermission. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determines the equality of two ServicePermission 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 ServicePermission object "implies" the
specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing
ServicePermission |
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 GET
get
.
public static final java.lang.String REGISTER
register
.
Constructor Detail |
---|
public ServicePermission(java.lang.String name, java.lang.String actions)
The name of the service is specified as a fully qualified class name. Wildcards may be used.
name ::= <class name> | <class name ending in ".*"> | *Examples:
org.osgi.service.http.HttpService org.osgi.service.http.* *For the
get
action, the name can also be a filter
expression. The filter gives access to the service properties as well as
the following attributes:
There are two possible actions: get
and
register
. The get
permission allows the owner
of this permission to obtain a service with this name. The
register
permission allows the bundle to register a service
under that name.
name
- The service class nameactions
- get
,register
(canonical order)
java.lang.IllegalArgumentException
- If the specified name is a filter
expression and either the specified action is not
get
or the filter has an invalid syntax.public ServicePermission(ServiceReference reference, java.lang.String actions)
ServicePermission
object to be used
by code that must perform checkPermission
for the
get
action. ServicePermission
objects created
with this constructor cannot be added to a ServicePermission
permission collection.
reference
- The requested service.actions
- The action get
.
java.lang.IllegalArgumentException
- If the specified action is not
get
or reference is null
.Method Detail |
---|
public boolean implies(java.security.Permission p)
ServicePermission
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()
get
,
register
.
getActions
in class java.security.BasicPermission
public java.security.PermissionCollection newPermissionCollection()
PermissionCollection
object for storing
ServicePermission objects.
- Overrides:
newPermissionCollection
in class java.security.Permission
- Returns:
- A new
PermissionCollection
object suitable for storing
ServicePermission
objects.
public boolean equals(java.lang.Object obj)
ServicePermission
.
equals
in class java.security.BasicPermission
obj
- The object to test for equality.
ServicePermission
, and has the same
class name and actions as this ServicePermission
object; false
otherwise.public int hashCode()
hashCode
in class java.security.BasicPermission
|
OSGi™ Service Platform Release 4 Version 4.2 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |