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

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

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

State.setPlatformProperties介绍

[英]Sets the platform properties of the state. The platform properties are used to resolve the following constraints:

  • The execution environment requirements (i.e. Bundle-RequiredExecutionEnvironment).

  • The platform filter requirements (i.e. Eclipse-PlatformFilter).

  • The native code requirements (i.e. Bundle-NativeCode).
    Arbitrary keys may be used in the platform properties but the following keys have a specified meaning:

  • osgi.nl - the platform language setting.

  • osgi.os - the platform operating system.

  • osgi.arch - the platform architecture.

  • osgi.ws - the platform windowing system.

  • osgi.resolverMode - the resolver mode. A value of "strict" will set the resolver mode to strict.

  • org.osgi.framework.system.packages - the packages exported by the system bundle.

  • org.osgi.framework.executionenvironment - the comma separated list of supported execution environments. This property is then used to resolve the required execution environment the bundles in a state.

  • org.osgi.framework.os.name - the name of the operating system. This property is used to resolve the osname attribute of bundle native code (i.e. Bundle-NativeCode).

  • org.osgi.framework.os.version - the version of the operating system. This property is used to resolve the osversion attribute of bundle native code (i.e. Bundle-NativeCode).

  • org.osgi.framework.processor - the processor name. This property is used to resolve the processor attribute of bundle native code (i.e. Bundle-NativeCode).

  • org.osgi.framework.language - the language being used. This property is used to resolve the language attribute of bundle native code (i.e. Bundle-NativeCode).

The values used for the supported properties can be String type to specify a single value for the property or they can by String[] to specify a list of values for the property.
[中]设置状态的平台属性。平台属性用于解决以下约束:
*执行环境要求(即Bundle RequiredExecutionEnvironment)。
*平台过滤器要求(即Eclipse平台过滤器)。
*本机代码要求(即捆绑NativeCode)。
平台属性中可以使用任意键,但以下键具有特定含义:
*奥斯基。nl——平台语言设置。
*奥斯基。操作系统——平台操作系统。
*奥斯基。arch——平台架构。
*奥斯基。ws-平台窗口系统。
*奥斯基。resolverMode—解析程序模式。值“strict”会将解析器模式设置为strict。
*组织。奥斯基。框架系统软件包——系统包导出的软件包。
*组织。奥斯基。框架executionenvironment—受支持的执行环境的逗号分隔列表。然后,该属性用于解析处于状态的捆绑包所需的执行环境。
*组织。奥斯基。框架操作系统。名称-操作系统的名称。此属性用于解析bundle原生代码(即bundle NativeCode)的osname属性。
*组织。奥斯基。框架操作系统。版本-操作系统的版本。此属性用于解析捆绑包本机代码(即捆绑包NativeCode)的osversion属性。
*组织。奥斯基。框架processor-处理器名称。此属性用于解析捆绑包本机代码(即捆绑包NativeCode)的处理器属性。
*组织。奥斯基。框架语言——正在使用的语言。此属性用于解析捆绑包本机代码(即捆绑包NativeCode)的语言属性。
支持的属性使用的值可以是字符串类型,以指定属性的单个值,也可以是字符串[],以指定属性的值列表。

代码示例

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

/**
 * set platfromProperties required to compose state object into
 * platformProperties of this state.
 * 
 * @param props
 */
private void setPlatformPropertiesToState(Dictionary props) {
  Properties platformProperties = setDefaultPlatformProperties();
  for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
    String key = (String) enumeration.nextElement();
    for (int i = 0; i < PROPS.length; i++) {
      if (key.equals(PROPS[i])) {
        platformProperties.put(key, props.get(key));
        break;
      }
    }
  }
  state.setPlatformProperties(platformProperties);
}

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

/**
 * set platfromProperties required to compose state object into
 * platformProperties of this state.
 * 
 * @param props
 */
private void setPlatformPropertiesToState(Dictionary<Object, Object> props) {
  Properties platformProperties = setDefaultPlatformProperties();
  for (Enumeration<Object> enumeration = props.keys(); enumeration.hasMoreElements();) {
    String key = (String) enumeration.nextElement();
    for (int i = 0; i < PROPS.length; i++) {
      if (key.equals(PROPS[i])) {
        platformProperties.put(key, props.get(key));
        break;
      }
    }
  }
  // TODO ignore uses directive for resolution here
  platformProperties.put("osgi.resolver.usesMode", "ignore"); //$NON-NLS-1$ //$NON-NLS-2$
  state.setPlatformProperties(platformProperties);
}

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

protected boolean initializePlatformProperties() {
  if (fExecutionEnvironments == null && !fNoProfile)
    setExecutionEnvironments();

  if (fEEListChanged) {
    fEEListChanged = false;
    return fState.setPlatformProperties(getProfilePlatformProperties());
  }
  return false;
}

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

protected boolean initializePlatformProperties() {
  if (fExecutionEnvironments == null && !fNoProfile)
    setExecutionEnvironments();
  if (fEEListChanged) {
    fEEListChanged = false;
    return fState.setPlatformProperties(getProfilePlatformProperties());
  }
  return false;
}

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

state.setPlatformProperties(stateProperties);

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

dictionary.put("osgi.nl", ANY_VALUE); //$NON-NLS-1$
getState().setPlatformProperties(dictionary);

代码示例来源:origin: org.codehaus.tycho/tycho-osgi-components

org.eclipse.osgi.framework.internal.core.Constants.DEVELOPMENT_MODE );
state.setPlatformProperties( properties );

代码示例来源: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 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/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.platform/org.eclipse.osgi.compatibility.state

private State createSystemState() {
  State state = factory.createState(true);
  StateConverter converter = new StateConverter(state);
  ModuleDatabase database = equinoxContainer.getStorage().getModuleDatabase();
  database.readLock();
  try {
    ModuleContainer container = equinoxContainer.getStorage().getModuleContainer();
    List<Module> modules = equinoxContainer.getStorage().getModuleContainer().getModules();
    for (Module module : modules) {
      ModuleRevision current = module.getCurrentRevision();
      BundleDescription description = converter.createDescription(current);
      state.addBundle(description);
    }
    state.setPlatformProperties(asDictionary(equinoxContainer.getConfiguration().getInitialConfig()));
    synchronizer = new PlatformBundleListener(state, converter, database, container);
    state.setResolverHookFactory(synchronizer);
    bc.addBundleListener(synchronizer);
    bc.addFrameworkListener(synchronizer);
    state.resolve();
    state.setTimeStamp(database.getRevisionsTimestamp());
  } finally {
    database.readUnlock();
  }
  return state;
}

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

private State createSystemState() {
  State state = factory.createState(true);
  StateConverter converter = new StateConverter(state);
  ModuleDatabase database = equinoxContainer.getStorage().getModuleDatabase();
  database.readLock();
  try {
    ModuleContainer container = equinoxContainer.getStorage().getModuleContainer();
    List<Module> modules = equinoxContainer.getStorage().getModuleContainer().getModules();
    for (Module module : modules) {
      ModuleRevision current = module.getCurrentRevision();
      BundleDescription description = converter.createDescription(current);
      state.addBundle(description);
    }
    state.setPlatformProperties(asDictionary(equinoxContainer.getConfiguration().getInitialConfig()));
    synchronizer = new PlatformBundleListener(state, converter, database, container);
    state.setResolverHookFactory(synchronizer);
    bc.addBundleListener(synchronizer);
    bc.addFrameworkListener(synchronizer);
    state.resolve();
    state.setTimeStamp(database.getRevisionsTimestamp());
  } finally {
    database.readUnlock();
  }
  return state;
}

相关文章