org.osgi.framework.ServicePermission Class Reference

List of all members.


Detailed Description

Indicates a bundle's authority to register or get a service.

Permission to get a service is required in order to detect events regarding the service. Untrusted bundles should not be able to detect the presence of certain services unless they have the appropriate ServicePermission to get the specific service.

Version:
Revision
1.14

Definition at line 42 of file ServicePermission.java.


Public Member Functions

 ServicePermission (String name, String actions)
 Create a new ServicePermission.
boolean implies (Permission p)
 Determines if a ServicePermission object "implies" the specified permission.
String getActions ()
 Returns the canonical string representation of the actions.
PermissionCollection newPermissionCollection ()
 Returns a new PermissionCollection object for storing ServicePermission objects.
boolean equals (Object obj)
 Determines the equalty of two ServicePermission objects.
int hashCode ()
 Returns the hash code value for this object.

Static Public Attributes

static final String GET = "get"
 The action string get (Value is "get").
static final String REGISTER = "register"
 The action string register (Value is "register").

Package Functions

 ServicePermission (String name, int mask)
 Package private constructor used by ServicePermissionCollection.
int getMask ()
 Returns the current action mask.

Constructor & Destructor Documentation

org.osgi.framework.ServicePermission.ServicePermission ( String  name,
String  actions 
)

Create a new ServicePermission.

The name of the service is specified as a fully qualified class name.

 ClassName ::= <class name> | <class name ending in ".*">
 

Examples:

 org.osgi.service.http.HttpService
 org.osgi.service.http.*
 org.osgi.service.snmp.*
 

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.

Parameters:
name class name
actions get,register (canonical order)

Definition at line 100 of file ServicePermission.java.

References org.osgi.framework.ServicePermission.getMask().

org.osgi.framework.ServicePermission.ServicePermission ( String  name,
int  mask 
) [package]

Package private constructor used by ServicePermissionCollection.

Parameters:
name class name
mask action mask

Definition at line 110 of file ServicePermission.java.


Member Function Documentation

boolean org.osgi.framework.ServicePermission.implies ( Permission  p  ) 

Determines if a ServicePermission object "implies" the specified permission.

Parameters:
p The target permission to check.
Returns:
true if the specified permission is implied by this object; false otherwise.

Definition at line 229 of file ServicePermission.java.

References org.osgi.framework.ServicePermission.action_mask.

String org.osgi.framework.ServicePermission.getActions (  ) 

Returns the canonical string representation of the actions.

Always returns present actions in the following order: get, register.

Returns:
The canonical string representation of the actions.

Definition at line 247 of file ServicePermission.java.

References org.osgi.framework.ServicePermission.GET, and org.osgi.framework.ServicePermission.REGISTER.

Referenced by org.osgi.framework.ServicePermission.hashCode().

PermissionCollection org.osgi.framework.ServicePermission.newPermissionCollection (  ) 

Returns a new PermissionCollection object for storing ServicePermission objects.

Returns:
A new PermissionCollection object suitable for storing ServicePermission objects.

Definition at line 276 of file ServicePermission.java.

boolean org.osgi.framework.ServicePermission.equals ( Object  obj  ) 

Determines the equalty of two ServicePermission objects.

Checks that specified object has the same class name and action as this ServicePermission.

Parameters:
obj The object to test for equality.
Returns:
true if obj is a ServicePermission, and has the same class name and actions as this ServicePermission object; false otherwise.

Definition at line 292 of file ServicePermission.java.

References org.osgi.framework.ServicePermission.action_mask.

int org.osgi.framework.ServicePermission.hashCode (  ) 

Returns the hash code value for this object.

Returns:
Hash code value for this object.

Definition at line 312 of file ServicePermission.java.

References org.osgi.framework.ServicePermission.getActions().

int org.osgi.framework.ServicePermission.getMask (  )  [package]

Returns the current action mask.

Used by the ServicePermissionCollection object.

Returns:
The actions mask.

Definition at line 322 of file ServicePermission.java.

Referenced by org.osgi.framework.ServicePermission.ServicePermission().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:24 2010 for OpenMobileIS by  doxygen 1.5.4