本文整理汇总了Java中org.osgi.framework.namespace.HostNamespace类的典型用法代码示例。如果您正苦于以下问题:Java HostNamespace类的具体用法?Java HostNamespace怎么用?Java HostNamespace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HostNamespace类属于org.osgi.framework.namespace包,在下文中一共展示了HostNamespace类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInUseBundleWirings
import org.osgi.framework.namespace.HostNamespace; //导入依赖的package包/类
private Set<BundleWiring> getInUseBundleWirings() {
Set<BundleWiring> wirings = new HashSet<>();
Collection<BundleCapability> bundles = fwkWiring.findProviders(ALL_BUNDLES_REQUIREMENT);
for (BundleCapability bundleCap : bundles) {
// Only pay attention to non JPMS boot modules.
// NOTE this means we will not create a real JPMS Module or Layer for this bundle
if (bundleCap.getAttributes().get(BOOT_JPMS_MODULE) == null) {
BundleRevision revision = bundleCap.getRevision();
BundleWiring wiring = revision.getWiring();
if (wiring != null && wiring.isInUse()) {
wirings.add(wiring);
}
if (revision.getBundle().getBundleId() == 0) {
// also store the system.bundle fragments because they may have exports unknown to JPMS
List<BundleWire> hostWires = wiring.getProvidedWires(HostNamespace.HOST_NAMESPACE);
for (BundleWire hostWire : hostWires) {
wirings.add(hostWire.getRequirerWiring());
}
}
}
}
return wirings;
}
示例2: BundleWiringLastModified
import org.osgi.framework.namespace.HostNamespace; //导入依赖的package包/类
public BundleWiringLastModified(BundleWiring hostWiring) {
// get the host last modified
if (hostWiring.isCurrent()) {
// use the current bundle id and last modified
lastModifieds.put(hostWiring.getBundle().getBundleId(), hostWiring.getBundle().getLastModified());
} else {
// use a unique negative id to indicate not current
lastModifieds.put(nextNotCurrentID.getAndDecrement(), hostWiring.getBundle().getLastModified());
}
for (BundleWire hostWire : hostWiring.getProvidedWires(HostNamespace.HOST_NAMESPACE)) {
// Always use the fragment id and last modified.
// It makes no difference if it is current or not because the host wiring indicates that.
lastModifieds.put(hostWire.getRequirer().getBundle().getBundleId(), hostWire.getRequirer().getBundle().getLastModified());
}
}