本文整理匯總了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();
}
示例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));
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}