类 PackageAdminImpl

    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      Bundle getBundle​(java.lang.Class clazz)
      Returns the bundle associated with this class if the class was loaded from a bundle, otherwise returns null.
      Bundle[] getBundles​(java.lang.String symbolicName, java.lang.String versionRange)
      Returns all bundles that have a specified symbolic name and whose version is in the specified version range.
      int getBundleType​(Bundle bundle)
      Returns the special type of the specified bundle.
      ExportedPackage getExportedPackage​(java.lang.String name)
      Returns the exported package associated with the specified package name.
      ExportedPackage[] getExportedPackages​(java.lang.String name)
      Gets the exported packages for the specified package name.
      ExportedPackage[] getExportedPackages​(Bundle bundle)
      Returns the packages exported by the specified bundle.
      Bundle[] getFragments​(Bundle bundle)
      Returns an array of attached fragment bundles for the specified bundle.
      Bundle[] getHosts​(Bundle bundle)
      Returns the host bundles to which the specified fragment bundle is attached.
      RequiredBundle[] getRequiredBundles​(java.lang.String symbolicName)
      Returns an array of required bundles having the specified symbolic name.
      void refreshPackages​(Bundle[] bundles)
      The OSGi specification states that refreshing packages is asynchronous; this method simply notifies the package admin thread to do a refresh.
      boolean resolveBundles​(Bundle[] bundles)
      Resolve the specified bundles.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • getBundle

        public Bundle getBundle​(java.lang.Class clazz)
        Returns the bundle associated with this class if the class was loaded from a bundle, otherwise returns null.
        指定者:
        getBundle 在接口中 PackageAdmin
        参数:
        clazz - the class for which to determine its associated bundle.
        返回:
        the bundle associated with the specified class, otherwise null.
      • getBundles

        public Bundle[] getBundles​(java.lang.String symbolicName,
                                   java.lang.String versionRange)
        Returns all bundles that have a specified symbolic name and whose version is in the specified version range. If no version range is specified, then all bundles with the specified symbolic name are returned. The array is sorted in descending version order.
        指定者:
        getBundles 在接口中 PackageAdmin
        参数:
        symbolicName - the target symbolic name.
        versionRange - the target version range.
        返回:
        an array of matching bundles sorted in descending version order.
        另请参阅:
        Constants.BUNDLE_VERSION_ATTRIBUTE
      • getBundleType

        public int getBundleType​(Bundle bundle)
        从接口复制的说明: PackageAdmin
        Returns the special type of the specified bundle. The bundle type values are: A bundle may be more than one type at a time. A type code is used to identify the bundle type for future extendability.

        If a bundle is not one or more of the defined types then 0x00000000 is returned.

        指定者:
        getBundleType 在接口中 PackageAdmin
        参数:
        bundle - The bundle for which to return the special type.
        返回:
        The special type of the bundle.
      • getExportedPackage

        public ExportedPackage getExportedPackage​(java.lang.String name)
        Returns the exported package associated with the specified package name. If there are more than one version of the package being exported, then the highest version is returned.
        指定者:
        getExportedPackage 在接口中 PackageAdmin
        参数:
        name - the name of the exported package to find.
        返回:
        the exported package or null if no matching package was found.
        另请参阅:
        PackageAdmin.getExportedPackages(String)
      • getExportedPackages

        public ExportedPackage[] getExportedPackages​(java.lang.String name)
        从接口复制的说明: PackageAdmin
        Gets the exported packages for the specified package name.
        指定者:
        getExportedPackages 在接口中 PackageAdmin
        参数:
        name - The name of the exported packages to be returned.
        返回:
        An array of the exported packages, or null if no exported packages with the specified name exists.
      • getExportedPackages

        public ExportedPackage[] getExportedPackages​(Bundle bundle)
        Returns the packages exported by the specified bundle.
        指定者:
        getExportedPackages 在接口中 PackageAdmin
        参数:
        bundle - the bundle whose exported packages are to be returned.
        返回:
        an array of packages exported by the bundle or null if the bundle does not export any packages.
      • getFragments

        public Bundle[] getFragments​(Bundle bundle)
        从接口复制的说明: PackageAdmin
        Returns an array of attached fragment bundles for the specified bundle. If the specified bundle is a fragment then null is returned. If no fragments are attached to the specified bundle then null is returned.

        This method does not attempt to resolve the specified bundle. If the specified bundle is not resolved then null is returned.

        指定者:
        getFragments 在接口中 PackageAdmin
        参数:
        bundle - The bundle whose attached fragment bundles are to be returned.
        返回:
        An array of fragment bundles or null if the bundle does not have any attached fragment bundles or the bundle is not resolved.
      • getHosts

        public Bundle[] getHosts​(Bundle bundle)
        从接口复制的说明: PackageAdmin
        Returns the host bundles to which the specified fragment bundle is attached.
        指定者:
        getHosts 在接口中 PackageAdmin
        参数:
        bundle - The fragment bundle whose host bundles are to be returned.
        返回:
        An array containing the host bundles to which the specified fragment is attached or null if the specified bundle is not a fragment or is not attached to any host bundles.
      • getRequiredBundles

        public RequiredBundle[] getRequiredBundles​(java.lang.String symbolicName)
        从接口复制的说明: PackageAdmin
        Returns an array of required bundles having the specified symbolic name.

        If null is specified, then all required bundles will be returned.

        指定者:
        getRequiredBundles 在接口中 PackageAdmin
        参数:
        symbolicName - The bundle symbolic name or null for all required bundles.
        返回:
        An array of required bundles or null if no required bundles exist for the specified symbolic name.
      • refreshPackages

        public void refreshPackages​(Bundle[] bundles)
                             throws java.lang.SecurityException
        The OSGi specification states that refreshing packages is asynchronous; this method simply notifies the package admin thread to do a refresh.
        指定者:
        refreshPackages 在接口中 PackageAdmin
        参数:
        bundles - array of bundles to refresh or null to refresh any bundles in need of refreshing.
        抛出:
        java.lang.SecurityException - If the caller does not have AdminPermission[System Bundle,RESOLVE] and the Java runtime environment supports permissions.
      • resolveBundles

        public boolean resolveBundles​(Bundle[] bundles)
        从接口复制的说明: PackageAdmin
        Resolve the specified bundles. The Framework must attempt to resolve the specified bundles that are unresolved. Additional bundles that are not included in the specified bundles may be resolved as a result of calling this method. A permissible implementation of this method is to attempt to resolve all unresolved bundles installed in the framework.

        If null is specified then the Framework will attempt to resolve all unresolved bundles. This method must not cause any bundle to be refreshed, stopped, or started. This method will not return until the operation has completed.

        指定者:
        resolveBundles 在接口中 PackageAdmin
        参数:
        bundles - The bundles to resolve or null to resolve all unresolved bundles installed in the Framework.
        返回:
        true if all specified bundles are resolved;