类 AdminPermission

  • 所有已实现的接口:
    java.io.Serializable, java.security.Guard

    public final class AdminPermission
    extends java.security.BasicPermission
    A bundle's authority to perform specific privileged administrative operations on or to get sensitive information about a bundle. The actions for this permission are:
     Action             Methods
     class              Bundle.loadClass
     execute            Bundle.start
                        Bundle.stop
                        BundleStartLevel.setStartLevel
     extensionLifecycle BundleContext.installBundle for extension bundles
                        Bundle.update for extension bundles
                        Bundle.uninstall for extension bundles
     lifecycle          BundleContext.installBundle
                        Bundle.update
                        Bundle.uninstall
     listener           BundleContext.addBundleListener for
                          SynchronousBundleListener
                        BundleContext.removeBundleListener for
                          SynchronousBundleListener
     metadata           Bundle.getHeaders
                        Bundle.getLocation
     resolve            FrameworkWiring.refreshBundles
                        FrameworkWiring.resolveBundles
     resource           Bundle.getResource
                        Bundle.getResources
                        Bundle.getEntry
                        Bundle.getEntryPaths
                        Bundle.findEntries
                        Bundle resource/entry URL creation
     startlevel         FrameworkStartLevel.setStartLevel
                        FrameworkStartLevel.setInitialBundleStartLevel
     context            Bundle.getBundleContext
     weave              WovenClass.getBytes
                        WovenClass.setBytes
                        WovenClass.getDynamicImports for modification
     

    The special action "*" will represent all actions. The resolve action is implied by the class, execute and resource actions.

    The name of this permission is a filter expression. The filter gives access to the following attributes:

    • signer - A Distinguished Name chain used to sign a bundle. Wildcards in a DN are not matched according to the filter string rules, but according to the rules defined for a DN chain.
    • location - The location of a bundle.
    • id - The bundle ID of the designated bundle.
    • name - The symbolic name of a bundle.
    Filter attribute names are processed in a case sensitive manner.
    作者:
    $Id: 2a803b07dcdc9af47ca0cb208d96fcd9c0bcfb0c $
    另请参阅:
    序列化表格
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static java.lang.String CLASS
      The action string class.
      static java.lang.String CONTEXT
      The action string context.
      static java.lang.String EXECUTE
      The action string execute.
      static java.lang.String EXTENSIONLIFECYCLE
      The action string extensionLifecycle.
      static java.lang.String LIFECYCLE
      The action string lifecycle.
      static java.lang.String LISTENER
      The action string listener.
      static java.lang.String METADATA
      The action string metadata.
      static java.lang.String RESOLVE
      The action string resolve.
      static java.lang.String RESOURCE
      The action string resource.
      static java.lang.String STARTLEVEL
      The action string startlevel.
      static java.lang.String WEAVE
      The action string weave.
    • 构造器概要

      构造器 
      构造器 说明
      AdminPermission()
      Creates a new AdminPermission object that matches all bundles and has all actions.
      AdminPermission​(java.lang.String filter, java.lang.String actions)
      Create a new AdminPermission.
      AdminPermission​(Bundle bundle, java.lang.String actions)
      Creates a new requested AdminPermission object to be used by the code that must perform checkPermission.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean equals​(java.lang.Object obj)
      Determines the equality of two AdminPermission objects.
      java.lang.String getActions()
      Returns the canonical string representation of the AdminPermission actions.
      int hashCode()
      Returns the hash code value for this object.
      boolean implies​(java.security.Permission p)
      Determines if the specified permission is implied by this object.
      java.security.PermissionCollection newPermissionCollection()
      Returns a new PermissionCollection object suitable for storing AdminPermissions.
      • 从类继承的方法 java.security.Permission

        checkGuard, getName, toString
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • CLASS

        public static final java.lang.String CLASS
        The action string class. The class action implies the resolve action.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • EXECUTE

        public static final java.lang.String EXECUTE
        The action string execute. The execute action implies the resolve action.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • EXTENSIONLIFECYCLE

        public static final java.lang.String EXTENSIONLIFECYCLE
        The action string extensionLifecycle.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • LIFECYCLE

        public static final java.lang.String LIFECYCLE
        The action string lifecycle.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • LISTENER

        public static final java.lang.String LISTENER
        The action string listener.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • METADATA

        public static final java.lang.String METADATA
        The action string metadata.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • RESOLVE

        public static final java.lang.String RESOLVE
        The action string resolve. The resolve action is implied by the class, execute and resource actions.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • RESOURCE

        public static final java.lang.String RESOURCE
        The action string resource. The resource action implies the resolve action.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • STARTLEVEL

        public static final java.lang.String STARTLEVEL
        The action string startlevel.
        从以下版本开始:
        1.3
        另请参阅:
        常量字段值
      • CONTEXT

        public static final java.lang.String CONTEXT
        The action string context.
        从以下版本开始:
        1.4
        另请参阅:
        常量字段值
      • WEAVE

        public static final java.lang.String WEAVE
        The action string weave.
        从以下版本开始:
        1.6
        另请参阅:
        常量字段值
    • 构造器详细资料

      • AdminPermission

        public AdminPermission()
        Creates a new AdminPermission object that matches all bundles and has all actions. Equivalent to AdminPermission("*","*");
      • AdminPermission

        public AdminPermission​(java.lang.String filter,
                               java.lang.String actions)
        Create a new AdminPermission. This constructor must only be used to create a permission that is going to be checked.

        Examples:

         (signer=\*,o=ACME,c=US)
         (&(signer=\*,o=ACME,c=US)(name=com.acme.*)
           (location=http://www.acme.com/bundles/*))
         (id>=1)
         

        When a signer key is used within the filter expression the signer value must escape the special filter chars ('*', '(', ')').

        Null arguments are equivalent to "*".

        参数:
        filter - A filter expression that can use signer, location, id, and name keys. A value of "*" or null matches all bundle. Filter attribute names are processed in a case sensitive manner.
        actions - class, execute, extensionLifecycle , lifecycle, listener, metadata, resolve , resource, startlevel, context or weave. A value of "*" or null indicates all actions.
        抛出:
        java.lang.IllegalArgumentException - If the filter has an invalid syntax.
      • AdminPermission

        public AdminPermission​(Bundle bundle,
                               java.lang.String actions)
        Creates a new requested AdminPermission object to be used by the code that must perform checkPermission. AdminPermission objects created with this constructor cannot be added to an AdminPermission permission collection.
        参数:
        bundle - A bundle.
        actions - class, execute, extensionLifecycle , lifecycle, listener, metadata, resolve , resource, startlevel, context, weave. A value of "*" or null indicates all actions.
        从以下版本开始:
        1.3
    • 方法详细资料

      • implies

        public boolean implies​(java.security.Permission p)
        Determines if the specified permission is implied by this object. This method throws an exception if the specified permission was not constructed with a bundle.

        This method returns true if the specified permission is an AdminPermission AND

        • this object's filter matches the specified permission's bundle ID, bundle symbolic name, bundle location and bundle signer distinguished name chain OR
        • this object's filter is "*"
        AND this object's actions include all of the specified permission's actions.

        Special case: if the specified permission was constructed with "*" filter, then this method returns true if this object's filter is "*" and this object's actions include all of the specified permission's actions

        覆盖:
        implies 在类中 java.security.BasicPermission
        参数:
        p - The requested permission.
        返回:
        true if the specified permission is implied by this object; false otherwise.
      • getActions

        public java.lang.String getActions()
        Returns the canonical string representation of the AdminPermission actions.

        Always returns present AdminPermission actions in the following order: class, execute, extensionLifecycle, lifecycle, listener, metadata, resolve, resource, startlevel, context, weave.

        覆盖:
        getActions 在类中 java.security.BasicPermission
        返回:
        Canonical string representation of the AdminPermission actions.
      • newPermissionCollection

        public java.security.PermissionCollection newPermissionCollection()
        Returns a new PermissionCollection object suitable for storing AdminPermissions.
        覆盖:
        newPermissionCollection 在类中 java.security.BasicPermission
        返回:
        A new PermissionCollection object.
      • equals

        public boolean equals​(java.lang.Object obj)
        Determines the equality of two AdminPermission objects.
        覆盖:
        equals 在类中 java.security.BasicPermission
        参数:
        obj - The object being compared for equality with this object.
        返回:
        true if obj is equivalent to this AdminPermission; false otherwise.
      • hashCode

        public int hashCode()
        Returns the hash code value for this object.
        覆盖:
        hashCode 在类中 java.security.BasicPermission
        返回:
        Hash code value for this object.