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

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

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

State.setResolverHookFactory介绍

[英]Sets the resolver hook factory for this state. The resolver hook factory is used during resolve operations according to the OSGi specification for the resolver hook factory.
[中]设置此状态的冲突解决程序挂钩工厂。根据分解器挂钩工厂的OSGi规范,分解器挂钩工厂在分解操作期间使用。

代码示例

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

相关文章