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.PermissionCollectionStores a set of ServicePermission permissions.- See Also:
Permission,Permissions,PermissionCollection
-
-
Field Summary
Fields Modifier and Type Field Description private booleanall_allowedBoolean saying if "*" is in the collection.private java.util.MapfilterPermissionsTable of permissions with filter expressions.private java.util.MappermissionsTable of permissions.private static java.io.ObjectStreamField[]serialPersistentFields(package private) static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ServicePermissionCollection()Creates an empty ServicePermissions object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.security.Permission permission)Adds a permission to this permission collection.private inteffective(java.lang.String requestedName, int desired, int effective)Consult permissions map to compute the effective permission for the requested permission name.java.util.Enumerationelements()Returns an enumeration of all theServicePermissionobjects in the container.booleanimplies(java.security.Permission permission)Determines if a set of permissions implies the permissions expressed inpermission.private voidreadObject(java.io.ObjectInputStream in)private voidwriteObject(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:
addin 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 thisServicePermissionCollectionobject 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:
impliesin classjava.security.PermissionCollection- Parameters:
permission- The Permission object to compare.- Returns:
trueifpermissionis a proper subset of a permission in the set;falseotherwise.
-
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 theServicePermissionobjects in the container.- Specified by:
elementsin 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.IOExceptionjava.lang.ClassNotFoundException
-
-