本文整理了Java中org.eclipse.osgi.service.resolver.State.updateBundle()
方法的一些代码示例,展示了State.updateBundle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。State.updateBundle()
方法的具体详情如下:
包路径:org.eclipse.osgi.service.resolver.State
类名称:State
方法名:updateBundle
[英]Updates an existing bundle description with the given description.
[中]使用给定的描述更新现有捆绑包描述。
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public void updateBundleDescription(BundleDescription description) {
if (description != null)
fState.updateBundle(description);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core
public BundleDescription addBundle(Map<String, String> manifest, File bundleLocation, long bundleId) throws CoreException {
try {
// OSGi requires a dictionary over any map
Hashtable<String, String> dictionaryManifest = new Hashtable<>(manifest);
BundleDescription descriptor = stateObjectFactory.createBundleDescription(fState, dictionaryManifest, bundleLocation.getAbsolutePath(), bundleId == -1 ? getNextId() : bundleId);
// new bundle
if (bundleId == -1) {
fState.addBundle(descriptor);
} else if (!fState.updateBundle(descriptor)) {
fState.addBundle(descriptor);
}
return descriptor;
} catch (BundleException e) {
// A stack trace isn't helpful here, but need to list the plug-in location causing the issue
MultiStatus status = new MultiStatus(PDECore.PLUGIN_ID, 0, NLS.bind(UtilMessages.ErrorReadingManifest, bundleLocation.toString()), null);
status.add(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, e.getMessage()));
throw new CoreException(status);
} catch (NumberFormatException e) {
} catch (IllegalArgumentException e) {
}
return null;
}
代码示例来源:origin: org.eclipse/org.eclipse.pde.core
public BundleDescription addBundle(Dictionary manifest, File bundleLocation, long bundleId) {
try {
BundleDescription descriptor = stateObjectFactory.createBundleDescription(
fState, manifest, bundleLocation.getAbsolutePath(),
bundleId == -1 ? getNextId() : bundleId);
// new bundle
if (bundleId == -1) {
fState.addBundle(descriptor);
} else if (!fState.updateBundle(descriptor)) {
fState.addBundle(descriptor);
}
return descriptor;
} catch (BundleException e) {
} catch (NumberFormatException e) {
} catch (IllegalArgumentException e) {
}
return null;
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.osgi.compatibility.state
BundleRevision revision = event.getBundle().adapt(BundleRevision.class);
if (revision != null) {
systemState.updateBundle(converter.createDescription(revision));
systemState.setTimeStamp(database.getRevisionsTimestamp());
代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.compatibility.state
BundleRevision revision = event.getBundle().adapt(BundleRevision.class);
if (revision != null) {
systemState.updateBundle(converter.createDescription(revision));
systemState.setTimeStamp(database.getRevisionsTimestamp());
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi
systemState.addBundle(newDescription);
else
systemState.updateBundle(newDescription);
break;
case BundleEvent.UNINSTALLED :
代码示例来源:origin: org.eclipse/org.eclipse.osgi
systemState.addBundle(newDescription);
else
systemState.updateBundle(newDescription);
break;
case BundleEvent.UNINSTALLED :
内容来源于网络,如有侵权,请联系作者删除!