当前位置: 首页>>代码示例>>Java>>正文


Java ConfigFactory.parseMap方法代码示例

本文整理汇总了Java中com.typesafe.config.ConfigFactory.parseMap方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigFactory.parseMap方法的具体用法?Java ConfigFactory.parseMap怎么用?Java ConfigFactory.parseMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.typesafe.config.ConfigFactory的用法示例。


在下文中一共展示了ConfigFactory.parseMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    String dbCredsFile = System.getProperty("dbCredsFile");
    if (StringUtils.isEmpty(dbCredsFile)) {
        dbCredsFile = "postgresql-creds.properties";
    }

    return new ParamReader(
            ConfigFactory.parseResources(dbCredsFile),
            "postgresql",
            ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "POSTGRESQL",
                    "logicalSchemas.schema1", "schema1",
                    "logicalSchemas.schema2", "schema2"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:17,代码来源:PostgreSqlParamReader.java

示例2: buildConfig

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
private Config buildConfig(String sRegex, String pRegex, String oRegex) {
    return ConfigFactory.parseMap(new HashMap() {{
        Map<String, Object> innerMap = new HashMap() {{
            put("s", sRegex != null ? Collections.singleton(sRegex) : null);
            put("p", pRegex != null ? Collections.singleton(pRegex) : null);
            put("o", oRegex != null ? Collections.singleton(oRegex) : null);
        }};
        put(RegExFilterProcessor.name, innerMap);
    }});
}
 
开发者ID:Lambda-3,项目名称:Stargraph,代码行数:11,代码来源:RegExFilterProcessorTest.java

示例3: configure

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@Override
public void configure(Context context) {
  String morphlineFile = context.getString(MORPHLINE_FILE_PARAM);
  String morphlineId = context.getString(MORPHLINE_ID_PARAM);
  if (morphlineFile == null || morphlineFile.trim().length() == 0) {
    throw new MorphlineCompilationException("Missing parameter: " + MORPHLINE_FILE_PARAM, null);
  }
  morphlineFileAndId = morphlineFile + "@" + morphlineId;
  
  if (morphlineContext == null) {
    FaultTolerance faultTolerance = new FaultTolerance(
        context.getBoolean(FaultTolerance.IS_PRODUCTION_MODE, false), 
        context.getBoolean(FaultTolerance.IS_IGNORING_RECOVERABLE_EXCEPTIONS, false),
        context.getString(FaultTolerance.RECOVERABLE_EXCEPTION_CLASSES));
    
    morphlineContext = new MorphlineContext.Builder()
      .setExceptionHandler(faultTolerance)
      .setMetricRegistry(SharedMetricRegistries.getOrCreate(morphlineFileAndId))
      .build();
  }
  
  Config override = ConfigFactory.parseMap(
      context.getSubProperties(MORPHLINE_VARIABLE_PARAM + "."));
  morphline = new Compiler().compile(
      new File(morphlineFile), morphlineId, morphlineContext, finalChild, override);
  
  this.mappingTimer = morphlineContext.getMetricRegistry().timer(
      MetricRegistry.name("morphline.app", Metrics.ELAPSED_TIME));
  this.numRecords = morphlineContext.getMetricRegistry().meter(
      MetricRegistry.name("morphline.app", Metrics.NUM_RECORDS));
  this.numFailedRecords = morphlineContext.getMetricRegistry().meter(
      MetricRegistry.name("morphline.app", "numFailedRecords"));
  this.numExceptionRecords = morphlineContext.getMetricRegistry().meter(
      MetricRegistry.name("morphline.app", "numExceptionRecords"));
}
 
开发者ID:moueimei,项目名称:flume-release-1.7.0,代码行数:36,代码来源:MorphlineHandlerImpl.java

示例4: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    String dbCredsFile = System.getProperty("dbCredsFile");
    if (StringUtils.isEmpty(dbCredsFile)) {
        dbCredsFile = "mssql-creds.properties";
    }

    return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
            "mssql", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "MSSQL",
                    "logicalSchemas.schema1", "oats"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:14,代码来源:MsSqlParamReader.java

示例5: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    return new ParamReader(ConfigFactory.parseResources("db2-creds.properties"), "db2", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
            "sysattrs.type", "DB2",
            "sysattrs.autoReorgEnabled", "true",
            "sysattrs.metadataLineReaderVersion", "3",
            "logicalSchemas.schema1", "DEPLOY_TRACKER"
    )));
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:9,代码来源:Db2ParamReader.java

示例6: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    String dbCredsFile = System.getProperty("dbCredsFile");
    if (StringUtils.isEmpty(dbCredsFile)) {
        dbCredsFile = "oracle-creds.properties";
    }

    return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
            "oracle", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "ORACLE",
                    "logicalSchemas.schema1", "schema1",
                    "logicalSchemas.schema2", "schema2"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:15,代码来源:OracleParamReader.java

示例7: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    String dbCredsFile = System.getProperty("dbCredsFile");
    if (StringUtils.isEmpty(dbCredsFile)) {
        dbCredsFile = "sybasease-creds.properties";
    }

    return new ParamReader(ConfigFactory.parseResources(dbCredsFile),
            "sybasease", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "SYBASE_ASE",
                    "logicalSchemas.schema1", "oats"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:14,代码来源:AseParamReader.java

示例8: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    return new ParamReader(ConfigFactory.parseResources("h2-creds.properties"),
            "h2", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "H2",
                    "logicalSchemas.schema1", "SCHEMA1",
                    "logicalSchemas.schema2", "SCHEMA2"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:10,代码来源:H2ParamReader.java

示例9: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    return new ParamReader(ConfigFactory.parseResources("sybaseiq-creds.properties"),
            "sybaseiq", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "SYBASE_IQ",
                    "logicalSchemas.schema1", "deploytest01"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:9,代码来源:SybaseIqParamReader.java

示例10: getParamReader

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public static ParamReader getParamReader() {
    return new ParamReader(ConfigFactory.parseResources("hsql-creds.properties"),
            "hsql", ConfigFactory.parseMap(Maps.mutable.<String, Object>of(
                    "sysattrs.type", "HSQL",
                    "logicalSchemas.schema1", "SCHEMA1",
                    "logicalSchemas.schema2", "SCHEMA2"
            ))
    );
}
 
开发者ID:goldmansachs,项目名称:obevo,代码行数:10,代码来源:HsqlParamReader.java

示例11: merge

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
protected Config merge() {
    Config config = ConfigFactory.parseMap(configHolder);
    if (fallback != null) {
        config = config.withFallback(fallback);
    }

    return config;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:9,代码来源:AbstractConfig.java

示例12: toConfig

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
public Config toConfig() {
    Map<String, Object> propertiesMap = new HashMap<>();
    propertiesMap.put(SERVER_HOST, host);
    propertiesMap.put(SERVER_PORT, port);
    return ConfigFactory.parseMap(propertiesMap);
}
 
开发者ID:florentw,项目名称:bench,代码行数:7,代码来源:JMSEndpoint.java

示例13: buildConfig

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
private Config buildConfig(List<String> strPatterns) {
    return ConfigFactory.parseMap(new HashMap() {{
        put(StopPropertyFilterProcessor.name, strPatterns);
    }});
}
 
开发者ID:Lambda-3,项目名称:Stargraph,代码行数:6,代码来源:StopPropertyFilterTest.java

示例14: getHostNameReturnsHostNameIfHostNameOverridden

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
@Test
public void getHostNameReturnsHostNameIfHostNameOverridden() {
    final Config config = ConfigFactory.parseMap(Collections.singletonMap("host-name", "foobar.example.net"));
    final CollectorHostNameConfiguration hostNameConfiguration = new CollectorHostNameConfiguration(config);
    assertEquals("foobar.example.net", hostNameConfiguration.getHostName());
}
 
开发者ID:DevOpsStudio,项目名称:Re-Collector,代码行数:7,代码来源:CollectorHostNameConfigurationTest.java

示例15: overrideParams

import com.typesafe.config.ConfigFactory; //导入方法依赖的package包/类
/**
 * Puts a new config atop of existing stack making the options
 * in the supplied config overriding existing options
 * Once put this config can't be removed
 *
 * @param cliOptions -  command line options to take presidency
 */
public void overrideParams(Map<String, ? extends Object> cliOptions) {
    Config cliConf = ConfigFactory.parseMap(cliOptions);
    overrideParams(cliConf);
}
 
开发者ID:talentchain,项目名称:talchain,代码行数:12,代码来源:SystemProperties.java


注:本文中的com.typesafe.config.ConfigFactory.parseMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。