当前位置: 首页>>代码示例>>Java>>正文


Java HostNamespace类代码示例

本文整理汇总了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;
}
 
开发者ID:tjwatson,项目名称:osgi-jpms-layer,代码行数:24,代码来源:LayerFactoryImpl.java

示例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());
	}
}
 
开发者ID:tjwatson,项目名称:osgi-jpms-layer,代码行数:16,代码来源:BundleWiringLastModified.java


注:本文中的org.osgi.framework.namespace.HostNamespace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。