Eclipse书籍部分翻译(英译中)9

来源:百度知道 编辑:UC知道 时间:2024/09/27 11:37:20
•Buddy loading is relatively undirected. Normally, the OSGi classloading infrastructure knows exactly where to go to find any given packagethis is the information gleaned from the MANIFEST.MF files. Typical buddy loading policies simply search successive buddies.
•It is possible that the buddy search will find the wrong class with the right name. If two buddies contain the same class, depending on the policy, it may be ambiguous as to which buddy ultimately supplies the class.
Dynamic-ImportPackage vs. Buddy Classloading
Readers familiar with OSGi may be scratching their heads asking, "What about Dynamic-ImportPackage?" For readers who are not familiar with OSGi, Dynamic-ImportPackage is a mechanism that allows a bundle to state its need to use a given set of packages but not force an early binding to the exporters of those packages. Rather, the binding to package exporters is done at runtime when the bundle tries to load from a dynamically imported

buddy装载相对无向。通常情况下,基础设施的OSGi classloading确切地知道该去哪里寻找任何特定packagethis是搜集的资料从MANIFEST.MF文件。典型的buddy装载的政策简单地搜寻历届个朋友。
•它可能是buddy搜索会找到错误的类名称的权利。如果有两个朋友含有相同的类,根据政策,它可能是模糊的,哪些buddy最终用品类。
动态ImportPackage与buddy Classloading
读者熟悉的OSGi可能会刮伤头问道: “怎么样动态ImportPackage ? ”读者谁不熟悉的OSGi ,动态ImportPackage是一种机制,允许捆绑说明其需要使用一组给定的软件包,但不会强制约束力早日向出口商这些软件包。相反,结合包出口商在运行时做时,捆绑尝试加载一个动态的进口封装。
因此,一些Class.forName ( )问题可以得到根本缓解,增加
DynamicImport封装: <list的软件包或*>
在MANIFEST.MF的插件使用Class.forName (字符串) 。这有以下弊端相比,好友装载说明如下:
•动态进口是unscoped 。也就是说,所有出口捆绑软件包审议。因此,寻找可能包括许多不相干的和无关的捆绑。相比之下,好友装载机制,可以使用的政策,动态信息,如插件依赖图驱动搜索类别。
•动态进口意味着间束的限制。也就是说,当一个捆绑一类负荷从乙捆绑使用动态输入,然后A是被视为依赖于b.如果B是更新或卸载, A是刷新。这种行为是有价值的保持一致当A实际用途和保持提到B的课。然而,一些系列化的情况有一个简单地使用B的班级暂时(例如,加载一些对象流)不应该有持久的依赖。
•动态导入软件包认为,只有明确出口的其他捆绑。再次这可以是一个可取的特点,但在各种情况下使用,如系列化,进口捆绑可能需要获得所有类别的系统,例如,负荷情况下从一个物体流。
这并不是说动态ImportPackage绝不应该被用来,公正,应适当使用。例如,当设置的包需要是众所周知的和进口捆绑有一个持久的依赖进口的软件包。// I translate not good bu