org.jboss.modules.Module.setDependencies()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(118)

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

Module.setDependencies介绍

暂无

代码示例

代码示例来源:origin: org.jboss.modules/jboss-modules

void setDependencies(final List<DependencySpec> dependencySpecs) {
  if (dependencySpecs == null) {
    throw new IllegalArgumentException("dependencySpecs is null");
  }
  final DependencySpec[] specs = dependencySpecs.toArray(new DependencySpec[dependencySpecs.size()]);
  for (DependencySpec spec : specs) {
    if (spec == null) {
      throw new IllegalArgumentException("dependencySpecs contains a null dependency specification");
    }
  }
  setDependencies(specs);
}

代码示例来源:origin: org.jboss.forge/jboss-modules

void setDependencies(final List<DependencySpec> dependencySpecs) {
  if (dependencySpecs == null) {
    throw new IllegalArgumentException("dependencySpecs is null");
  }
  final DependencySpec[] specs = dependencySpecs.toArray(new DependencySpec[dependencySpecs.size()]);
  for (DependencySpec spec : specs) {
    if (spec == null) {
      throw new IllegalArgumentException("dependencySpecs contains a null dependency specification");
    }
  }
  setDependencies(specs);
}

代码示例来源:origin: org.jboss.modules/jboss-modules

/**
 * Replaces the dependencies for the specified module and relinks against
 * the new modules This is an advanced method that should be used carefully,
 * since it alters a live module. Modules that import dependencies that are
 * re-exported from the specified module will not automatically be updated
 * to reflect the change. For this to occur {@link #relink(Module)} must be
 * called on all of them.
 *
 * @param module the module to update and relink
 * @param dependencies the new dependency list
 * @throws ModuleLoadException if relinking failed
 * @throws SecurityException if the module was not defined by this module loader, or if the module loader does not
 *      have the required permissions associated with it
 */
protected void setAndRelinkDependencies(Module module, List<DependencySpec> dependencies) throws ModuleLoadException {
  if (! canRedefine) {
    throw new SecurityException("Module redefinition requires canRedefineModule permission");
  }
  if (module.getModuleLoader() != this) {
    throw new SecurityException("Module is not defined by this module loader");
  }
  module.setDependencies(dependencies);
  module.relinkIfNecessary();
}

代码示例来源:origin: org.jboss.forge/jboss-modules

/**
 * Replaces the dependencies for the specified module and relinks against
 * the new modules This is an advanced method that should be used carefully,
 * since it alters a live module. Modules that import dependencies that are
 * re-exported from the specified module will not automatically be updated
 * to reflect the change. For this to occur {@link #relink(Module)} must be
 * called on all of them.
 *
 * @param module the module to update and relink
 * @param dependencies the new dependency list
 * @throws ModuleLoadException if relinking failed
 * @throws SecurityException if the module was not defined by this module loader, or if the module loader does not
 *      have the required permissions associated with it
 */
protected void setAndRelinkDependencies(Module module, List<DependencySpec> dependencies) throws ModuleLoadException {
  if (! canRedefine) {
    throw new SecurityException("Module redefinition requires canRedefineModule permission");
  }
  if (module.getModuleLoader() != this) {
    throw new SecurityException("Module is not defined by this module loader");
  }
  module.setDependencies(dependencies);
  module.relinkIfNecessary();
}

代码示例来源:origin: org.jboss.modules/jboss-modules

public Module run() throws Exception {
    final ModuleLogger log = Module.log;
    final String name = moduleSpec.getName();
    final Module module = new Module(moduleSpec, ModuleLoader.this);
    module.getClassLoaderPrivate().recalculate();
    module.setDependencies(moduleSpec.getDependenciesInternal());
    log.moduleDefined(name, ModuleLoader.this);
    try {
      futureModule.setModule(module);
      return module;
    } catch (RuntimeException e) {
      log.trace(e, "Failed to load module %s", name);
      throw e;
    } catch (Error e) {
      log.trace(e, "Failed to load module %s", name);
      throw e;
    }
  }
});

代码示例来源:origin: org.jboss.forge/jboss-modules

public Module run() throws Exception {
    final ModuleLogger log = Module.log;
    final ModuleIdentifier moduleIdentifier = moduleSpec.getModuleIdentifier();
    final Module module = new Module(moduleSpec, ModuleLoader.this);
    module.getClassLoaderPrivate().recalculate();
    module.setDependencies(moduleSpec.getDependenciesInternal());
    log.moduleDefined(moduleIdentifier, ModuleLoader.this);
    try {
      futureModule.setModule(module);
      return module;
    } catch (RuntimeException e) {
      log.trace(e, "Failed to load module %s", moduleIdentifier);
      throw e;
    } catch (Error e) {
      log.trace(e, "Failed to load module %s", moduleIdentifier);
      throw e;
    }
  }
});

相关文章