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


Java BundleRevision.TYPE_FRAGMENT属性代码示例

本文整理汇总了Java中org.osgi.framework.wiring.BundleRevision.TYPE_FRAGMENT属性的典型用法代码示例。如果您正苦于以下问题:Java BundleRevision.TYPE_FRAGMENT属性的具体用法?Java BundleRevision.TYPE_FRAGMENT怎么用?Java BundleRevision.TYPE_FRAGMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.osgi.framework.wiring.BundleRevision的用法示例。


在下文中一共展示了BundleRevision.TYPE_FRAGMENT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: waitBundleStarted

public static void waitBundleStarted(Bundle bundle) {
	if ((bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) {
		return;
	}

	BundleContext ctx;
	int state;

	// 自旋锁
	for (;;) {
		state = bundle.getState();
		if (state != Bundle.STARTING && state != Bundle.ACTIVE) {
			return;
		}
		ctx = bundle.getBundleContext();
		if (ctx == null) {
			Thread.yield();
		} else {
			return;
		}
	}
}
 
开发者ID:to2mbn,项目名称:LoliXL,代码行数:22,代码来源:BundleUtils.java

示例2: isFragment

private boolean isFragment(Bundle bundle) {
    BundleRevision bundleRevision = bundle.adapt(BundleRevision.class);
    if (bundleRevision == null)
        throw new NullPointerException("Null bundle revision means that bundle has probably been uninstalled: " +
                                               bundle.getSymbolicName() + ":" + bundle.getVersion());
    return (bundleRevision.getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:7,代码来源:BundleLoader.java

示例3: isFragment

private static boolean isFragment(Bundle bundle) {
    return (bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) > 0;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:3,代码来源:DeploymentInstaller.java

示例4: updateDependenciesState

private void updateDependenciesState(Map<MavenArtifact, ArtifactLoader> artifact2loader, Set<PluginDescription> toInstall, Set<PluginDescription> toUninstall) {
	Objects.requireNonNull(artifact2loader);
	Objects.requireNonNull(toInstall);
	Objects.requireNonNull(toUninstall);

	LOGGER.fine(format("Update state: toInstall=%s, toUninstall=%s", toInstall, toUninstall));

	IllegalStateException startExCollection = null;

	try {
		synchronized (lock) {
			try {
				performActions(computeActions(toInstall, toUninstall), artifact2loader);
				checkDependenciesState();
			} finally {
				FrameworkWiring frameworkWiring = bundleContext.getBundle(0).adapt(FrameworkWiring.class);

				CountDownLatch latch = new CountDownLatch(1);
				frameworkWiring.refreshBundles(null, event -> latch.countDown());
				latch.await();

				Set<Bundle> bundles = bundle2artifact.keySet();
				frameworkWiring.resolveBundles(bundles);

				for (Bundle bundle : bundles) {
					if (bundle.getState() != Bundle.ACTIVE &&
							bundle.getState() != Bundle.STARTING &&
							(bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) == 0) {
						try {
							bundle.start(Bundle.START_ACTIVATION_POLICY);
						} catch (Throwable exStart) {
							LOGGER.log(Level.WARNING, format("Bundle %s couldn't start", bundle), exStart);
							if (startExCollection == null)
								startExCollection = new IllegalStateException("One or more bundles couldn't start");
							startExCollection.addSuppressed(exStart);
						}
					}
				}
			}
		}
	} catch (Throwable ex) {
		LOGGER.log(Level.SEVERE, "Couldn't finish updating dependencies state", ex);
		IllegalStateException exToThrow = new IllegalStateException("Couldn't finish updating dependencies state", ex);
		if (startExCollection != null)
			exToThrow.addSuppressed(startExCollection);
		throw exToThrow;
	}

	if (startExCollection != null)
		throw startExCollection;
}
 
开发者ID:to2mbn,项目名称:LoliXL,代码行数:51,代码来源:PluginServiceImpl.java

示例5: isFragment

private static boolean isFragment(BundleWiring wiring) {
	return (wiring.getRevision().getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
 
开发者ID:tjwatson,项目名称:osgi-jpms-layer,代码行数:3,代码来源:LayerFactoryImpl.java

示例6: isFragment

public boolean isFragment ()
{
    return ( this.bundleRevision.getTypes () & BundleRevision.TYPE_FRAGMENT ) > 0;
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:4,代码来源:BundleInformation.java

示例7: isFragment

private boolean isFragment(Bundle bundle) {
    return (bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
 
开发者ID:KRMAssociatesInc,项目名称:eHMP,代码行数:3,代码来源:HmpPluginService.java

示例8: isFragment

public static boolean isFragment(Bundle bundle) {
	return (bundle.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:3,代码来源:OSGiUtil.java


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