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


Java Bundle.RESOLVED属性代码示例

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


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

示例1: activate

@Activate
void activate(BundleContext ctx) {
    this.base = new File("").toURI();
    // Find the resolved vaadin bundle
    this.vaadinResourceBundles = new BundleTracker<Bundle>(ctx, Bundle.RESOLVED |
            Bundle.STARTING | Bundle.ACTIVE | Bundle.STOPPING,
                new BundleTrackerCustomizer<Bundle>() {
                    @Override
                    public Bundle addingBundle(Bundle bundle, BundleEvent event) {
                        return VAADIN_SERVER_BUNDLE.equals(bundle.getSymbolicName()) ?
                                bundle : null;
                    }

                    @Override
                    public void modifiedBundle(Bundle bundle, BundleEvent event, Bundle object) {

                    }

                    @Override
                    public void removedBundle(Bundle bundle, BundleEvent event, Bundle object) {
                    }
            });
    this.vaadinResourceBundles.open();
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:24,代码来源:UiServletContext.java

示例2: testIsBundleResolved

public void testIsBundleResolved() throws Exception {
	OsgiBundleUtilsTest.state = Bundle.UNINSTALLED;
	assertFalse(OsgiBundleUtils.isBundleResolved(bundle));

	OsgiBundleUtilsTest.state = Bundle.INSTALLED;
	assertFalse(OsgiBundleUtils.isBundleResolved(bundle));

	OsgiBundleUtilsTest.state = Bundle.ACTIVE;
	assertTrue(OsgiBundleUtils.isBundleResolved(bundle));

	OsgiBundleUtilsTest.state = Bundle.RESOLVED;
	assertTrue(OsgiBundleUtils.isBundleResolved(bundle));
	
	OsgiBundleUtilsTest.state = Bundle.STOPPING;
	assertTrue(OsgiBundleUtils.isBundleResolved(bundle));

	OsgiBundleUtilsTest.state = Bundle.STARTING;
	assertTrue(OsgiBundleUtils.isBundleResolved(bundle));

}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:20,代码来源:OsgiBundleUtilsTest.java

示例3: isEnabled

public @Override boolean isEnabled() {
    switch (b.getState()) {
    case Bundle.RESOLVED:
    case Bundle.ACTIVE:
    case Bundle.STARTING:
    case Bundle.STOPPING:
        return true;
    default:
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:OSGiMainLookup.java

示例4: start

@Override
public void start(BundleContext ctx) {
    LOG.debug("Starting EclipseLink adapter");
    context = ctx;
    ctx.addBundleListener(this);
    
    for (Bundle b : ctx.getBundles()) {
        if ((b.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED | Bundle.STOPPING)) != 0) 
            handlePotentialEclipseLink(b);
    }
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:11,代码来源:Activator.java

示例5: assertAllBundlesResolved

private void assertAllBundlesResolved() {
    int mask = Bundle.RESOLVED | Bundle.STARTING | Bundle.STOPPING | Bundle.ACTIVE;
    for (Bundle bundle : this.bundleContext.getBundles()) {
        assertTrue("Unresolved bundle " + bundle.getSymbolicName(), (bundle.getState() & mask) > 0);
    }
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:6,代码来源:InstallerIntegrationTest.java

示例6: isBundleStartingResolvedOrActive

/**
 * Checks if the specified bundle is resolved or active.
 *
 * @param bundle the bundle
 * @return true, if the bundle is resolved or active
 */
private boolean isBundleStartingResolvedOrActive(Bundle bundle) {
	return (bundle.getState()==Bundle.STARTING || bundle.getState()==Bundle.RESOLVED || bundle.getState()==Bundle.ACTIVE); 
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:9,代码来源:BundleEvaluator.java

示例7: isBundleResolved

/**
 * Indicates if the given bundle is resolved or not.
 * 
 * @param bundle OSGi bundle
 * @return true if the given bundle is resolved, false otherwise
 * @see Bundle#RESOLVED
 */
public static boolean isBundleResolved(Bundle bundle) {
	Assert.notNull(bundle, "bundle is required");
	return (bundle.getState() >= Bundle.RESOLVED);
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:11,代码来源:OsgiBundleUtils.java


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