org.apache.geronimo.kernel.repository.Environment.setConfigId()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(81)

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

Environment.setConfigId介绍

暂无

代码示例

代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-farm

protected Environment buildEnvironment(ConfigurationData configurationData) {
  Environment environment = new Environment(defaultEnvironment);
  environment.setConfigId(configurationData.getId());
  return environment;
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment

/**
   * Guarantees that the argument Environment will have a present and fully
   * qualified module ID when this method returns. If the Environment is
   * missing a module ID, or has a partial module ID (isResolved() == false)
   * then this method will fill in any missing values.  If the module ID is
   * present and resolved, then this method does nothing.
   *
   * @param environment        The Environment to check and populate
   * @param defaultArtifactId  The artifactId to use if the Envrionment does
   *                           not have a module ID at all
   * @param defaultType        The type to use if the Environment is lacking
   *                           a module ID or the module ID is lacking a type
   */
  public void resolve(Environment environment, String defaultArtifactId, String defaultType) {
    if(environment.getConfigId() == null) {
      environment.setConfigId(resolve(new Artifact(null, defaultArtifactId, (Version)null, defaultType), defaultType));
    } else if(!environment.getConfigId().isResolved()) {
      environment.setConfigId(resolve(environment.getConfigId(), defaultType));
    }
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-farm

public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
  storeDelegate.install(clusterInfo, configurationData);
  installSlaveConfiguration(configurationData);
  Environment environment = configurationData.getEnvironment();
  Artifact slaveConfigId = environment.getConfigId();
  Artifact masterConfigId = configNameBuilder.buildMasterConfigurationName(slaveConfigId);
  environment.setConfigId(masterConfigId);
  installMasterConfiguration(configurationData, slaveConfigId);
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-deployment

private void createTempManifest() throws DeploymentException, IOException {
  Environment env = new Environment(environment);
  Artifact id = env.getConfigId();
  env.setConfigId(new Artifact(id.getGroupId(), id.getArtifactId() + "-DEPLOYMENT", id.getVersion(), id.getType()));
  env.addToBundleClassPath(bundleClassPath);
  env.setBundleActivator(null);
  env.addDynamicImportPackage("*");
  OSGiMetaDataBuilder osgiMetaDataBuilder = new OSGiMetaDataBuilder(bundleContext, new DummyExportPackagesSelector());
  try {
    osgiMetaDataBuilder.build(env);
  } catch (IllegalConfigurationException e) {
    throw new DeploymentException(e);
  }
  Manifest manifest;
  try {
    manifest = env.getManifest();
  } catch (ManifestException e) {
    throw new DeploymentException(e);
  }
  File metaInf = new File(getConfigurationDir(), "META-INF");
  metaInf.mkdirs();
  FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
  PrintWriter pw = new PrintWriter(fw);
  try {
    manifest.write(pw);
  } finally {
    pw.close();
    fw.close();
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-upgrade

private static void insertEnvironment(Artifact configId, Artifact parentId, XmlCursor cursor, QName environmentQname, boolean suppressDefaultEnvironment) {
  positionEnvironment(cursor);
  Environment environment = new Environment();
  environment.setConfigId(configId);
  if (parentId != null) {
    environment.addDependency(parentId, ImportType.ALL);
  }
  environment.setSuppressDefaultEnvironment(suppressDefaultEnvironment);
  extractDependencies(cursor, environment);
  EnvironmentType environmentType = EnvironmentBuilder.buildEnvironmentType(environment);
  cursor.beginElement(environmentQname);
  XmlCursor element = environmentType.newCursor();
  try {
    element.copyXmlContents(cursor);
  } finally {
    element.dispose();
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-j2ee-builder

applicationInfo.getEnvironment().setConfigId(configId);
try {
  try {

代码示例来源:origin: org.apache.geronimo.modules/geronimo-openejb-builder

if (environmentType != null) {
  if (environmentType.getModuleId() != null) {
    environment.setConfigId(toArtifact(environmentType.getModuleId(), null));

代码示例来源:origin: org.apache.geronimo.framework/geronimo-service-builder

public static void mergeEnvironments(Environment environment, Environment additionalEnvironment) {
  if (additionalEnvironment != null) {
    //TODO merge configIds??
    if (environment.getConfigId() == null) {
      environment.setConfigId(additionalEnvironment.getConfigId());
    }
    environment.addDependencies(additionalEnvironment.getDependencies());
    environment.addToBundleClassPath(additionalEnvironment.getBundleClassPath());
    environment.addImportPackages(additionalEnvironment.getImportPackages());
    environment.addExportPackages(additionalEnvironment.getExportPackages());
    environment.addRequireBundles(additionalEnvironment.getRequireBundles());
    environment.addDynamicImportPackages(additionalEnvironment.getDynamicImportPackages());
    if (environment.getBundleActivator() == null && additionalEnvironment.getBundleActivator() != null) {
      environment.setBundleActivator(additionalEnvironment.getBundleActivator());
    }
    
    environment.setSuppressDefaultEnvironment(environment.isSuppressDefaultEnvironment() || additionalEnvironment.isSuppressDefaultEnvironment());
    
    ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
    ClassLoadingRules additionalClassLoadingRules = additionalEnvironment.getClassLoadingRules();
    classLoadingRules.merge(additionalClassLoadingRules);
  }
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-service-builder

if (environmentType != null) {
  if (environmentType.isSetModuleId()) {
    environment.setConfigId(toArtifact(environmentType.getModuleId(), null));

相关文章