Class ServicePermissionCollection

java.lang.Object
java.security.PermissionCollection
org.osgi.framework.ServicePermissionCollection
All Implemented Interfaces:
Serializable

final class ServicePermissionCollection extends PermissionCollection
Stores a set of ServicePermission permissions.
See Also:
  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      See Also:
    • permissions

      private transient Map<String,ServicePermission> permissions
      Table of permissions.
    • all_allowed

      private boolean all_allowed
      Boolean saying if "*" is in the collection.
    • filterPermissions

      private Map<String,ServicePermission> filterPermissions
      Table of permissions with filter expressions.
    • serialPersistentFields

      private static final ObjectStreamField[] serialPersistentFields
  • Constructor Details

    • ServicePermissionCollection

      public ServicePermissionCollection()
      Creates an empty ServicePermissions object.
  • Method Details

    • add

      public void add(Permission permission)
      Adds a permission to this permission collection.
      Specified by:
      add in class PermissionCollection
      Parameters:
      permission - The Permission object to add.
      Throws:
      IllegalArgumentException - If the specified permission is not a ServicePermission object.
      SecurityException - If this ServicePermissionCollection object has been marked read-only.
    • implies

      public boolean implies(Permission permission)
      Determines if a set of permissions implies the permissions expressed in permission.
      Specified by:
      implies in class PermissionCollection
      Parameters:
      permission - The Permission object to compare.
      Returns:
      true if permission is a proper subset of a permission in the set; false otherwise.
    • effective

      private int effective(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 Enumeration<Permission> elements()
      Returns an enumeration of all the ServicePermission objects in the container.
      Specified by:
      elements in class PermissionCollection
      Returns:
      Enumeration of all the ServicePermission objects.
    • writeObject

      private void writeObject(ObjectOutputStream out) throws IOException
      Throws:
      IOException
    • readObject

      private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException