org.eclipse.osgi.service.resolver.State.updateBundle()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(68)

本文整理了Java中org.eclipse.osgi.service.resolver.State.updateBundle()方法的一些代码示例,展示了State.updateBundle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。State.updateBundle()方法的具体详情如下:
包路径:org.eclipse.osgi.service.resolver.State
类名称:State
方法名:updateBundle

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 :

相关文章

微信公众号

最新文章

更多