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

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

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

State.setResolver介绍

[英]Sets the resolver associated with this state. A state can work with at most one resolver at any given time. Similarly, a resolver can work with at most one state at a time.

To ensure that this state and the given resovler are properly linked, the following expression must be included in this method if the given resolver (value) is not identical to the result of this.getResolver().

if (this.getResolver() != value) value.setState(this);

[中]设置与此状态关联的冲突解决程序。一个状态在任何给定时间最多可以使用一个解析器。类似地,解析器一次最多可以处理一个状态。
为了确保此状态和给定解析程序正确链接,如果给定解析程序(值)与此结果不一致,则此方法中必须包含以下表达式。getResolver()。

if (this.getResolver() != value) value.setState(this);

代码示例

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

public State createState(boolean createResolver) {
  State result = internalCreateState();
  if (createResolver)
    result.setResolver(new ResolverImpl(false));
  return result;
}

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

public State createState(boolean createResolver) {
  State result = internalCreateState();
  if (createResolver)
    result.setResolver(new ResolverImpl(false));
  return result;
}

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

public State createState(boolean createResolver) {
  State result = internalCreateState();
  if (createResolver)
    result.setResolver(new ResolverImpl(false));
  return result;
}

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

public State createState(boolean createResolver) {
  State result = internalCreateState();
  if (createResolver)
    result.setResolver(new ResolverImpl(false));
  return result;
}

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

protected MinimalState(MinimalState state) {
  this.fState = stateObjectFactory.createState(state.fState);
  this.fState.setPlatformProperties(state.fState.getPlatformProperties());
  this.fState.setResolver(Platform.getPlatformAdmin().getResolver());
  this.fId = state.fId;
  this.fEEListChanged = state.fEEListChanged;
  this.fExecutionEnvironments = state.fExecutionEnvironments;
  this.fNoProfile = state.fNoProfile;
}

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

protected MinimalState(MinimalState state) {
  this.fState = stateObjectFactory.createState(state.fState);
  this.fState.setPlatformProperties(state.fState.getPlatformProperties());
  this.fState.setResolver(Platform.getPlatformAdmin().createResolver());
  this.fId = state.fId;
  this.fEEListChanged = state.fEEListChanged;
  this.fExecutionEnvironments = state.fExecutionEnvironments;
  this.fNoProfile = state.fNoProfile;
  this.fSystemBundle = state.fSystemBundle;
}

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

protected void copyState(State state) {
  fStateCopy = state.getFactory().createState(state);
  fStateCopy.setResolver(Platform.getPlatformAdmin().getResolver());
  fStateCopy.setPlatformProperties(state.getPlatformProperties());
}

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

protected void copyState(State state) {
  fStateCopy = state.getFactory().createState(state);
  fStateCopy.setResolver(Platform.getPlatformAdmin().createResolver());
  fStateCopy.setPlatformProperties(state.getPlatformProperties());
}

代码示例来源: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);
}

相关文章