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

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

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

State.resolve介绍

[英]Same as State.resolve(true);
[中]和州政府一样。决心(正确);

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

@Override
public void resolve(boolean increment) {
  state.resolve(increment);
}

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

public void resolve(boolean increment) {
  state.resolve(increment);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

private synchronized StateDelta internalResolveState(boolean incremental) {
  boolean fullBuildRequired = initializePlatformProperties();
  return fState.resolve(incremental && !fullBuildRequired);
}

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

private synchronized StateDelta internalResolveState(boolean incremental) {
  boolean fullBuildRequired = initializePlatformProperties();
  return fState.resolve(incremental && !fullBuildRequired);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

/**
 * Resolves the state incrementally based on the given bundle names.
 *
 * @param symbolicNames
 * @return state delta
 */
public StateDelta resolveState(String[] symbolicNames) {
  if (initializePlatformProperties()) {
    return fState.resolve(false);
  }
  List<BundleDescription> bundles = new ArrayList<>();
  for (int i = 0; i < symbolicNames.length; i++) {
    BundleDescription[] descriptions = fState.getBundles(symbolicNames[i]);
    for (int j = 0; j < descriptions.length; j++) {
      bundles.add(descriptions[j]);
    }
  }
  return fState.resolve(bundles.toArray(new BundleDescription[bundles.size()]));
}

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

protected State getState(String os, String ws, String arch) {
  // the way plug-in export works, the os, ws and arch should ALWAYS equal the target settings.
  if (os.equals(TargetPlatform.getOS()) 
      && ws.equals(TargetPlatform.getWS())
      && arch.equals(TargetPlatform.getOSArch())
      && fStateCopy != null) {
    fStateCopy.resolve(true);
    return fStateCopy;
  }
  return super.getState(os, ws, arch);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

@Override
protected State getState(String os, String ws, String arch) {
  // the way plug-in export works, the os, ws and arch should ALWAYS equal the target settings.
  if (os.equals(TargetPlatform.getOS()) && ws.equals(TargetPlatform.getWS()) && arch.equals(TargetPlatform.getOSArch()) && fStateCopy != null) {
    fStateCopy.resolve(true);
    return fStateCopy;
  }
  return super.getState(os, ws, arch);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.pde.core

protected State getState(String os, String ws, String arch) {
  State main = TargetPlatformHelper.getState();
  if (os.equals(TargetPlatform.getOS()) && ws.equals(TargetPlatform.getWS()) && arch.equals(TargetPlatform.getOSArch())) {
    return main;
  }
  if (fStateCopy == null) {
    copyState(main);
  }
  Dictionary<String, String>[] dictionaries = fStateCopy.getPlatformProperties();
  for (int i = 0; i < dictionaries.length; i++) {
    Dictionary<String, String> properties = dictionaries[i];
    properties.put("osgi.os", os); //$NON-NLS-1$
    properties.put("osgi.ws", ws); //$NON-NLS-1$
    properties.put("osgi.arch", arch); //$NON-NLS-1$
  }
  fStateCopy.resolve(false);
  return fStateCopy;
}

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

protected State getState(String os, String ws, String arch) {
  State main = TargetPlatformHelper.getState();
  if (os.equals(TargetPlatform.getOS()) 
      && ws.equals(TargetPlatform.getWS())
      && arch.equals(TargetPlatform.getOSArch())) {
    return main;
  }             
  if (fStateCopy == null) {
    copyState(main);
  }
  
  Dictionary[] dictionaries = fStateCopy.getPlatformProperties();
  for (int i = 0; i < dictionaries.length; i++) {
    Dictionary properties = dictionaries[i];
    properties.put("osgi.os", os); //$NON-NLS-1$
    properties.put("osgi.ws", ws); //$NON-NLS-1$
    properties.put("osgi.arch", arch); //$NON-NLS-1$			
  }
  fStateCopy.resolve(false);
  return fStateCopy;
}

代码示例来源: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.scout.sdk.deps/org.eclipse.pde.core

@Override
public void run(IProgressMonitor monitor) throws CoreException {
  if (FACTORY == null)
    FACTORY = Platform.getPlatformAdmin().getFactory();
  monitor.beginTask("", fModels.length + 1); //$NON-NLS-1$
  fState = FACTORY.createState(true);
  for (int i = 0; i < fModels.length; i++) {
    BundleDescription bundle = fModels[i].getBundleDescription();
    if (bundle != null)
      fState.addBundle(FACTORY.createBundleDescription(bundle));
    monitor.worked(1);
  }
  fState.setPlatformProperties(fProperties);
  fState.resolve(false);
  monitor.done();
}

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

public void run(IProgressMonitor monitor) throws CoreException {
  if (FACTORY == null)
    FACTORY = Platform.getPlatformAdmin().getFactory();
  monitor.beginTask("", fModels.length + 1); //$NON-NLS-1$
  fState = FACTORY.createState(true);
  for (int i = 0; i < fModels.length; i++) {
    BundleDescription bundle = fModels[i].getBundleDescription();
    if (bundle != null)
      fState.addBundle(FACTORY.createBundleDescription(bundle));
    monitor.worked(1);
  }
  fState.setPlatformProperties(fProperties);
  fState.resolve(false);
  monitor.done();
}

代码示例来源:origin: org.eclipse.tycho/tycho-core

protected void resolveState(State state) {
  state.resolve(false);
  // warn about missing/ambiguous/inconsistent system.bundle
  BundleDescription[] bundles = state.getBundles("system.bundle");
  if (bundles == null || bundles.length == 0) {
    logger.warn("No system.bundle");
  } else if (bundles.length > 1) {
    logger.warn("Multiple system.bundles " + Arrays.toString(bundles));
  } else if (bundles[0].getBundleId() != SYSTEM_BUNDLE_ID) {
    logger.warn("system.bundle bundleId == " + bundles[0].getBundleId());
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools

@Override
public void addApiComponents(IApiComponent[] components) throws CoreException {
  HashSet<String> ees = new HashSet<>();
  for (IApiComponent apiComponent : components) {
    BundleComponent component = (BundleComponent) apiComponent;
    if (component.isSourceComponent()) {
      continue;
    }
    BundleDescription description = component.getBundleDescription();
    getState().addBundle(description);
    addComponent(component);
    ees.addAll(Arrays.asList(component.getExecutionEnvironments()));
  }
  resolveSystemLibrary(ees);
  getState().resolve();
}

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

protected State getState(String os, String ws, String arch) {
  State main = TargetPlatformHelper.getState();
  if (os.equals(TargetPlatform.getOS()) 
      && ws.equals(TargetPlatform.getWS())
      && arch.equals(TargetPlatform.getOSArch())) {
    return main;
  }             
  if (fStateCopy == null) {
    fStateCopy = main.getFactory().createState(main);
    fStateCopy.setResolver(Platform.getPlatformAdmin().getResolver());
    fStateCopy.setPlatformProperties(main.getPlatformProperties());
  }
  
  Dictionary[] dictionaries = fStateCopy.getPlatformProperties();
  for (int i = 0; i < dictionaries.length; i++) {
    Dictionary properties = dictionaries[i];
    properties.put("osgi.os", os); //$NON-NLS-1$
    properties.put("osgi.ws", ws); //$NON-NLS-1$
    properties.put("osgi.arch", arch); //$NON-NLS-1$			
  }
  fStateCopy.resolve(false);
  return fStateCopy;
}

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

private void cleanRemovalPendings(State systemState, BundleDescription[] removalPendings) {
  if (removalPendings.length == 0)
    return;
  systemState.resolve(removalPendings);
  for (int i = 0; i < removalPendings.length; i++) {
    Object userObject = removalPendings[i].getUserObject();
    if (userObject instanceof BundleLoaderProxy) {
      BundleLoader.closeBundleLoader((BundleLoaderProxy) userObject);
      try {
        ((BundleLoaderProxy) userObject).getBundleData().close();
      } catch (IOException e) {
        // ignore
      }
    } else if (userObject instanceof BundleData) {
      try {
        ((BundleData) userObject).close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}

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

private void cleanRemovalPendings(State systemState, BundleDescription[] removalPendings) {
  if (removalPendings.length == 0)
    return;
  systemState.resolve(removalPendings);
  for (int i = 0; i < removalPendings.length; i++) {
    Object userObject = removalPendings[i].getUserObject();
    if (userObject instanceof BundleLoaderProxy) {
      BundleLoader.closeBundleLoader((BundleLoaderProxy) userObject);
      try {
        ((BundleLoaderProxy) userObject).getBundleData().close();
      } catch (IOException e) {
        // ignore
      }
    } else if (userObject instanceof BundleData) {
      try {
        ((BundleData) userObject).close();
      } catch (IOException e) {
        // ignore
      }
    }
  }
}

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

private void readTargetState(URL[] urls, IProgressMonitor monitor) {
  fTargetTimestamp = computeTimestamp(urls);
  File dir = new File(DIR, Long.toString(fTargetTimestamp) + ".target"); //$NON-NLS-1$
  if ((fState = readStateCache(dir)) == null || !fAuxiliaryState.readPluginInfoCache(dir)) {
    createNewTargetState(true, urls, monitor);
    if (!dir.exists())
      dir.mkdirs();
    fAuxiliaryState.savePluginInfo(dir);
    resolveState(false);
    saveState(dir);
  } else {
    boolean propertiesChanged = initializePlatformProperties();
    fState.setResolver(Platform.getPlatformAdmin().getResolver());
    if (propertiesChanged)
      fState.resolve(false);
    fId = fState.getBundles().length;
  }
  if (!fExtensionRegistry.readExtensionsCache(dir))
    fExtensionRegistry.saveExtensions(fState, dir);
}

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

protected void setActive(boolean active) {
  if (active) {
    State state = PDECore.getDefault().getModelManager().getState().getState();
    state.resolve(true);
    fTreeViewer.setInput(state);
    PDECore.getDefault().getModelManager().addPluginModelListener(this);
  } else {
    PDECore.getDefault().getModelManager().removePluginModelListener(this);
  }
}

相关文章