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

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

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

State.getRemovalPending介绍

[英]Returns descriptions for all bundles in a removal pending state.
[中]返回处于删除挂起状态的所有捆绑包的说明。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public List<BundleRevision> getRevisions() {
  List<BundleRevision> revisions = new ArrayList<BundleRevision>();
  BundleDescription current = getBundleDescription();
  if (current != null)
    revisions.add(current);
  BundleDescription[] removals = framework.adaptor.getState().getRemovalPending();
  for (BundleDescription removed : removals) {
    if (removed.getBundleId() == getBundleId() && removed != current) {
      revisions.add(removed);
    }
  }
  return revisions;
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public Collection<Bundle> getRemovalPendingBundles() {
  // TODO need to consolidate our removal pending tracking.
  // We currently have three places this is kept (PackageAdminImpl, StateImpl and ResolverImpl)
  // Using the state's because it has easy access to the uninstalled Bundle objects
  BundleDescription[] removals = framework.adaptor.getState().getRemovalPending();
  Set<Bundle> result = new HashSet<Bundle>();
  for (int i = 0; i < removals.length; i++) {
    Object ref = removals[i].getUserObject();
    if (ref instanceof BundleReference)
      result.add(((BundleReference) ref).getBundle());
  }
  return result;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public List<BundleRevision> getRevisions() {
  List<BundleRevision> revisions = new ArrayList<BundleRevision>();
  BundleDescription current = getBundleDescription();
  if (current != null)
    revisions.add(current);
  BundleDescription[] removals = framework.adaptor.getState().getRemovalPending();
  for (BundleDescription removed : removals) {
    if (removed.getBundleId() == getBundleId() && removed != current) {
      revisions.add(removed);
    }
  }
  return revisions;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public Collection<Bundle> getRemovalPendingBundles() {
  // TODO need to consolidate our removal pending tracking.
  // We currently have three places this is kept (PackageAdminImpl, StateImpl and ResolverImpl)
  // Using the state's because it has easy access to the uninstalled Bundle objects
  BundleDescription[] removals = framework.adaptor.getState().getRemovalPending();
  Set<Bundle> result = new HashSet<Bundle>();
  for (int i = 0; i < removals.length; i++) {
    Object ref = removals[i].getUserObject();
    if (ref instanceof BundleReference)
      result.add(((BundleReference) ref).getBundle());
  }
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi.compatibility.state

private void resolve(boolean uninstalled) {
  database.readLock();
  try {
    if (lastResolveStamp != database.getRevisionsTimestamp()) {
      Collection<ModuleRevision> containerRemovalPending = container.getRemovalPending();
      BundleDescription[] stateRemovalPendingDescs = systemState.getRemovalPending();
      Collection<BundleDescription> stateRemovalPending = new ArrayList<>(stateRemovalPendingDescs.length);
      for (BundleDescription description : stateRemovalPendingDescs) {
        if (!containerRemovalPending.contains(description.getUserObject())) {
          stateRemovalPending.add(description);
        }
      }
      if (!stateRemovalPending.isEmpty()) {
        systemState.resolve(stateRemovalPending.toArray(new BundleDescription[stateRemovalPending.size()]), true);
      } else {
        systemState.resolve(!uninstalled);
      }
      lastResolveStamp = database.getRevisionsTimestamp();
      systemState.setTimeStamp(database.getRevisionsTimestamp());
    }
  } finally {
    database.readUnlock();
  }
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.osgi.compatibility.state

private void resolve(boolean uninstalled) {
  database.readLock();
  try {
    if (lastResolveStamp != database.getRevisionsTimestamp()) {
      Collection<ModuleRevision> containerRemovalPending = container.getRemovalPending();
      BundleDescription[] stateRemovalPendingDescs = systemState.getRemovalPending();
      Collection<BundleDescription> stateRemovalPending = new ArrayList<BundleDescription>(stateRemovalPendingDescs.length);
      for (BundleDescription description : stateRemovalPendingDescs) {
        if (!containerRemovalPending.contains(description.getUserObject())) {
          stateRemovalPending.add(description);
        }
      }
      if (!stateRemovalPending.isEmpty()) {
        systemState.resolve(stateRemovalPending.toArray(new BundleDescription[stateRemovalPending.size()]), true);
      } else {
        systemState.resolve(!uninstalled);
      }
      lastResolveStamp = database.getRevisionsTimestamp();
      systemState.setTimeStamp(database.getRevisionsTimestamp());
    }
  } finally {
    database.readUnlock();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

BundleDescription[] removalPendings = systemState.getRemovalPending();
if (removalPendings.length > 0) {
  if (!shutdown)

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

BundleDescription[] removalPendings = systemState.getRemovalPending();
if (removalPendings.length > 0) {
  if (!shutdown)

相关文章