コード例 #1
0
  @Override
  public void setApplicationContext(final ApplicationContext ctx) {

    this.isRunningInGSC = USMUtils.isRunningInGSC(ctx);
    this.puWorkDir = USMUtils.getPUWorkDir(ctx);
    this.puExtDir = new File(puWorkDir, "ext");
  }
コード例 #2
0
  private ServiceConfiguration handleDsl() throws DSLException {
    File dslFile = null;

    if (serviceFileName != null) {
      dslFile = new File(this.puExtDir, this.serviceFileName);
    }

    DSLReader dslReader = new DSLReader();
    dslReader.setAdmin(USMUtils.getAdmin());
    dslReader.setClusterInfo(clusterInfo);
    dslReader.setPropertiesFileName(propertiesFileName);
    dslReader.setRunningInGSC(isRunningInGSC);
    dslReader.setDslFile(dslFile);
    dslReader.setWorkDir(this.puExtDir);
    dslReader.setDslFileNameSuffix(DSLReader.SERVICE_DSL_FILE_NAME_SUFFIX);

    // When loading a service in the USM, expect the jar files to
    // be available in the pu lib dir, and ignore the contents of usmlib
    dslReader.setLoadUsmLib(false);

    logger.info("Loading Service configuration from DSL File");
    Service service = dslReader.readDslEntity(Service.class);
    return new ServiceConfiguration(
        service, dslReader.getContext(), this.puExtDir, dslReader.getDslFile());
  }