Package org.osgi.framework
Class ServicePermissionCollection
- java.lang.Object
-
- java.security.PermissionCollection
-
- org.osgi.framework.ServicePermissionCollection
-
- All Implemented Interfaces:
java.io.Serializable
final class ServicePermissionCollection extends java.security.PermissionCollection
Stores a set of ServicePermission permissions.- See Also:
Permission
,Permissions
,PermissionCollection
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
all_allowed
Boolean saying if "*" is in the collection.private java.util.Map
filterPermissions
Table of permissions with filter expressions.private java.util.Map
permissions
Table of permissions.private static java.io.ObjectStreamField[]
serialPersistentFields
(package private) static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ServicePermissionCollection()
Creates an empty ServicePermissions object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.security.Permission permission)
Adds a permission to this permission collection.private int
effective(java.lang.String requestedName, int desired, int effective)
Consult permissions map to compute the effective permission for the requested permission name.java.util.Enumeration
elements()
Returns an enumeration of all theServicePermission
objects in the container.boolean
implies(java.security.Permission permission)
Determines if a set of permissions implies the permissions expressed inpermission
.private void
readObject(java.io.ObjectInputStream in)
private void
writeObject(java.io.ObjectOutputStream out)
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
permissions
private transient java.util.Map permissions
Table of permissions.
-
all_allowed
private boolean all_allowed
Boolean saying if "*" is in the collection.
-
filterPermissions
private java.util.Map filterPermissions
Table of permissions with filter expressions.
-
serialPersistentFields
private static final java.io.ObjectStreamField[] serialPersistentFields
-
-
Method Detail
-
add
public void add(java.security.Permission permission)
Adds a permission to this permission collection.- Specified by:
add
in classjava.security.PermissionCollection
- Parameters:
permission
- The Permission object to add.- Throws:
java.lang.IllegalArgumentException
- If the specified permission is not a ServicePermission object.java.lang.SecurityException
- If thisServicePermissionCollection
object has been marked read-only.
-
implies
public boolean implies(java.security.Permission permission)
Determines if a set of permissions implies the permissions expressed inpermission
.- Specified by:
implies
in classjava.security.PermissionCollection
- Parameters:
permission
- The Permission object to compare.- Returns:
true
ifpermission
is a proper subset of a permission in the set;false
otherwise.
-
effective
private int effective(java.lang.String requestedName, int desired, int effective)
Consult permissions map to compute the effective permission for the requested permission name.- Parameters:
requestedName
- The requested service name.desired
- The desired actions.effective
- The effective actions.- Returns:
- The new effective actions.
-
elements
public java.util.Enumeration elements()
Returns an enumeration of all theServicePermission
objects in the container.- Specified by:
elements
in classjava.security.PermissionCollection
- Returns:
- Enumeration of all the ServicePermission objects.
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-