<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 1  文章 - 37  trackbacks - 0
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    留言簿(16)

    隨筆分類

    隨筆檔案

    文章分類

    文章檔案

    test

    搜索

    •  

    最新評論

    7.1 Introduction

    Bundles can export packages to other bundles. This exporting creates a dependency between the bundle exporting a package and the bundle using the package. When the exporting bundle is uninstalled or updated, a decision must be taken regarding any shared packages.
    The Package Admin service provides an interface to let the Management Agent make this decision.
    Bundles能輸出包到其他bundles,這個輸出將會在輸出bundle與引入bundle間發生一個依賴關系,當輸出bundle被卸載或更新時,對相關的共享包必須做出一個決定(相應動作)。包管理服務提供了一個接口讓Management Agent來做這個決定。

    7.1.1 Essentials

    • Information – The Package Admin service must provide the sharing status of all packages. This should include information about the importing bundles and exporting bundle.
    • Policy – The Package Admin service must allow a management agent to provide a policy for package sharing when bundles are updated and uninstalled.
    • Minimal update – Only bundles that depend on the package that needs to be resolved should have to be restarted when packages are forced to be refreshed.

    • Information – 包管理服務必須提供所有包的共享狀態,這應該包括輸出bundle和引入bundle的相關信息。
    • Minimal update – 依賴于需要被解析的包的bundles應該在這些包被強制刷新的時候被重啟

    7.1.2 Entities

    • PackageAdmin – The interface that provides access to the internal Framework package sharing mechanism.
    • ExportedPackage – The interface provides package information and its sharing status.
    • RequiredBundle – The interfaces provides information about the bindings of required bundles.
    • Management Agent – A bundle that is provided by the Operator to implement an Operator specific policy.

    • PackageAdmin – 接口,提供了對框架內部包共享機制的訪問。
    • ExportedPackage – 接口,提供包的信息和包的共享狀態。
    • RequiredBundle – 接口,提供required bundles的綁定相關的信息
    • Management Agent – 一個bundle,由操作人員提供,用于實現操作人員指定的策略。



    7.1.3 Operation

    The Framework’s system bundle should provide a Package Admin service for the Management Agent. The Package Admin service must be registered under the org.osgi.service.packageadmin.PackageAdmin interface by the system bundle. It provides access to the internal structures of the Framework related to package sharing, fragments and required bundles. This is an optional singleton service, so at most one Package Admin service must be
    registered at any moment in time.
    框架的系統bundle應該為Management Agent提供一個包管理服務,包管理服務必須由系統bundle注冊在org.osgi.service.packageadmin.PackageAdmin的接口名下,它提供對框架內部結構中關于包共享,片段和required bundles的訪問。這是一個可選的單例服務,因此最多只有一個包管理服務被注冊。

    The Framework must always leave the package sharing intact for packages exported by a bundle that is uninstalled or updated. A Management Agent can then choose to force the framework to refresh these packages using the Package Admin service. A policy of always using the most current packages exported by installed bundles can be implemented with a Management Agent that watches Framework events for bundles being uninstalled or updated, and then refreshes the packages of those bundles using the Package Admin service.
    一個卸載或更新的bundle輸出的包,框架必須總是保證這些包沒有被使用,這時Management Agent就可以使用包管理服務選擇強制框架刷新這些包。總是使用安裝bundle輸出的通用包的策略可以被一個監聽卸載或更新bundle的框架事件的Management Agent實現,然后使用包管理服務刷新那些bundles的包。

    7.2 Package Admin

    The Package Admin service is intended to allow a Management Agent to define the policy for managing package sharing. It provides methods for examining the status of the shared packages. It also allows the Management Agent to refresh the packages and stop and restart bundles as necessary.
    包管理服務允許一個Management Agent定義管理包共享的策略,它提供了檢查共享包的狀態的方法,也允許Management Agent刷新包,并在需要的時候停止和重啟bundles

    7.2.1 Package Sharing

    The PackageAdmin class provides the following methods:
    • getExportedPackage(String) – Returns an ExportedPackage object that provides information about the requested package. This information can be used to make the decision to refresh the package.
    • getExportedPackages(Bundle) – Returns a list of ExportedPackage objects for each package that the given bundle exports.
    • refreshPackages(Bundle[]) – The management agent may call this method to refresh the exported packages of the specified bundles. The actual work must happen asynchronously. The Framework must send a Framework.PACKAGES_REFRESHED when all packages have been refreshed.
    • resolveBundles(Bundle[]) – The Framework must attempt to resolve the given bundles.

    類PackageAdmin提供了一下方法:
    • getExportedPackage(String) – 返回一個提供了與requested package相關的信息的ExportedPackage對象,這個信息可以決定是否需要刷新包。
    • getExportedPackages(Bundle) – 返回一個ExportedPackage對象的列表,給定的bundle所輸出的包
    • refreshPackages(Bundle[]) – management agent可以調用這個方法去刷新指定的bundle輸出的包,這個動作必須是同步的。當所有包都被刷新后,框架必須發出一個Framework.PACKAGES_REFRESHED事件。
    • resolveBundles(Bundle[]) – 框架必須嘗試解析給定的bundles

    7.2.2 Bundle Information

    There is only the Bundle interface in the Framework API while bundles can perform different roles in the Framework. The Package Admin service provides access to this structural information.
    • getBundle(Class) – Answer the bundle with the class loader that loaded the given class.
    • getBundles(String,String)– Find a the set of bundles with the given bundle symbolic name and that fall within the given version. If the version is null, all bundles with the given bundle symbolic name are returned.
    • getBundleType(Bundle) – Answer the type of the bundle. This is a bitmap of the different types. The following type is defined:
      • BUNDLE_TYPE_FRAGMENT– The bundle is a fragment.

    bundles可以在框架中扮演不同的角色,但是這些bundle都在來自一個接口Bundle,包管理服務提供了對這個結構信息的訪問:
    • getBundle(Class) – 查找一個bundle,這個bundle的classloader加載了這個給定的類
    • getBundles(String,String)– 查找一個bundle集合,通過給定的標記名和版本號,如果版本號是null,那么將返回給定的標記名的bundles
    • getBundleType(Bundle) – 查詢bundle的類型。定義了以下類型
      • BUNDLE_TYPE_FRAGMENT–bundle是個片段

    7.2.3 Fragments and Required Bundles

    The Package Admin service provides access to the network that is created by by requiring bundles and hosting fragments.
    • getFragments(Bundle) – Return an array of bundles that currently act as fragment to the given bundle. If there are no fragments attached, null must be returned.
    • getHosts(Bundle) – Return the bundle that acts as host to this fragment bundle. The given bundle should be an attached fragment bundle, otherwise null is returned.
    • getRequiredBundles(String) – Return an array of RequiredBundle objects that match the given name (or all of the given name is null). The RequiredBundle object provides structural information about a required bundle.

    包管理服務提供了對由需求bundle和主片段形成的關系網的訪問。
    • getFragments(Bundle) – 返回一個bundles的集合,這個集合中的bundles是給定bundle的片段,如果沒有片段,返回null
    • getHosts(Bundle) – 返回給定bundle的宿主bundle。這個給定的bundle應該是個片段,否則返回null。
    • getRequiredBundles(String) – 返回RequiredBundle對象的集合,這個集合匹配了給定的名字(bundle標記名),如果給定的名字是null,將返回所有required的bundles。每一個RequiredBundle對象提供了對一個required的bundle的結構信息的描述。

    7.2.4 Exported Package

    Information about the shared packages is provided by the ExportedPackage objects. These objects provide detailed information about the bundles that import and export the package. This information can be used by a Management Agent to guide its decisions.
    與共享包相關的信息是由ExportedPackage對象提供的,這些ExportedPackage對象提供了引入包或輸出包的bundles的細節信息,這些信息可以被Management Agent用于參考它的決定。

    7.2.5 Refreshing Packages and Start Level Service

    Bundles may be stopped and later started when the refreshPackages(Bundle[]) method is called. If the Start Level Service is present, the stopping and starting of bundles must not violate the start level constraints. This implies that bundles with a higher start level must be stopped before bundles with a lower start level are stopped. Vice versa, bundles should not be started
    before all the bundles with a lower start level are started. See Startup Sequence on page 207.

    當調用refreshPackages(Bundle[])方法時,bundles可能會先停止,然后又啟動,如果設置了啟動級別服務,那么bundles的停止和啟動必須不能違反啟動級別的限制,也就是說高啟動級別的bundles必須比低啟動級別的bundles先停止,低啟動級別的bundles比高啟動級別的bundles先啟動。

    posted on 2008-04-29 15:11 Phrancol Yang 閱讀(860) 評論(0)  編輯  收藏 所屬分類: OSGI
    主站蜘蛛池模板: 狼人大香伊蕉国产WWW亚洲| 亚洲av无码一区二区三区天堂古代 | a视频在线观看免费| 亚洲综合色自拍一区| 中文字幕手机在线免费看电影| 最新精品亚洲成a人在线观看| 中文字幕成人免费高清在线| 亚洲国产无套无码av电影| 成人免费无码H在线观看不卡| 国产成人精品日本亚洲网站 | 产传媒61国产免费| 亚洲欭美日韩颜射在线二| a毛片在线还看免费网站| 久久精品国产亚洲AV香蕉| 国产精品永久免费10000| 亚洲人成www在线播放| 日本免费人成视频播放| 一区二区免费国产在线观看| 在线观看国产区亚洲一区成人| 波多野结衣免费一区视频| 亚洲精品在线不卡| 国产成人免费网站在线观看| 日韩精品无码永久免费网站| 狠狠色伊人亚洲综合成人| 久久w5ww成w人免费| 亚洲色丰满少妇高潮18p| 中文字幕专区在线亚洲| 亚洲免费在线视频| 亚洲AV无码一区二区三区久久精品| 亚洲国产一级在线观看| 最近的中文字幕大全免费8| 亚洲另类无码一区二区三区| 亚洲欧洲精品成人久久奇米网 | 老司机午夜精品视频在线观看免费 | 中文字幕亚洲日本岛国片| 五月婷婷在线免费观看| 国产亚洲福利一区二区免费看| 亚洲精品无码mv在线观看网站| 成人免费无码视频在线网站| 国产免费播放一区二区| 亚洲一级黄色大片|