Package com.typesafe.config

Examples of com.typesafe.config.Config


    this.config = config;
  }

  private ActorSystem applicationSystem() {
    applicationSystemEnabled = true;
    Config akkaConf = ConfigFactory.load(config);
    ActorSystem system = ActorSystem.create("application", akkaConf);
    logger.info("Starting application default Akka system.");
    return system;
  }
View Full Code Here


          HAVALO_EXTERNAL_CONFIG_FILENAME + " configuration file " +
          "at: " + catalinaConfigFile.getAbsolutePath());
        configFile = catalinaConfigFile;
      }
    }
    Config config = null;
    try {
      // If we found a valid config file specific to the supported
      // Servlet container, then load it.  Otherwise, return null meaning
      // no override file was found.
      config = (configFile != null) ?
View Full Code Here

            String variablePrefix = MorphlineResultToSolrMapper.MORPHLINE_VARIABLE_PARAM + ".";
            if (entry.getKey().startsWith(variablePrefix)) {
                morphlineVariables.put(entry.getKey().substring(variablePrefix.length()), entry.getValue());
            }
        }
        Config override = ConfigFactory.parseMap(morphlineVariables);
        this.morphline = new Compiler().compile(new File(morphlineFile), morphlineId, morphlineContext, collector,
                override);
       
        for (Map.Entry<String,String> entry : params.entrySet()) {
            String fieldPrefix = MorphlineResultToSolrMapper.MORPHLINE_FIELD_PARAM + ".";
View Full Code Here

  public AtomicInteger localLoad;
 
 
  public SupermanActorSystem(String port, String masterUrl) {
    // Override the configuration of the port when specified as program argument
    final Config config = ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port).
        withFallback(ConfigFactory.parseString("akka.cluster.roles = [frontend]")).
        withFallback(ConfigFactory.load("remoteactorconfig"));
    system = ActorSystem.create("ClusterSystem", config);
    localLoad = new AtomicInteger(0);
   
    this.masterUrl = masterUrl;
    ClusterState.memberStates.clear();
    List<String> temp = config.getStringList("akka.cluster.seed-nodes");
    String hostAddress = config.getString("akka.remote.netty.tcp.hostname");
    for (String actorAddress : temp) {
      Pattern pattern = Pattern.compile("@.+:");
      Matcher matcher = pattern.matcher(actorAddress);
      if (matcher.find()) {
        String url = matcher.group().substring(1, matcher.end()-matcher.start()-1);
View Full Code Here

import com.typesafe.config.ConfigFactory;

public class DistributedUtils {
  public static Map<String, String> httpPort;
  public static void initHttpPort() {
    Config config = ConfigFactory.load("remoteactorconfig");
    List<String> akkaAddress = config.getStringList("akka.supermanHTTPPort.akkaAddress");
    List<String> httpPortList = config.getStringList("akka.supermanHTTPPort.httpPort");
    httpPort = new HashMap<String, String>();
    for (int i=0; i<akkaAddress.size(); i++) {
      httpPort.put(akkaAddress.get(i), httpPortList.get(i));
    }
  }
View Full Code Here

    entrySet.addAll(fieldBundle.root().entrySet());

    for (final Entry<String, ConfigValue> entry : entrySet) {

      final String configId = entry.getKey();
      final Config configField = fieldBundle.getConfig(configId);

      final FormField formField = fieldEntry(configId,
          configField.withFallback(fieldDefault));

      fieldList.add(formField);

    }
View Full Code Here

  /**
   * default form field properties
   */
  public static Map<String, String> propsDefault() {

    final Config root = ConfigHelp.reference();

    return propsFrom(root);

  }
View Full Code Here

  /**
   * form filed default value extract convention
   */
  public static Map<String, String> propsFrom(final Config root) {

    final Config config = root.getConfig("form-field-bundle");

    final Map<String, String> props = new HashMap<String, String>();

    final Set<String> keySet = config.root().keySet();

    for (final String configId : keySet) {

      final Config configField = config.getConfig(configId);

      final String configValue = configField.getString("default-value");

      props.put(configId, configValue);

    }

View Full Code Here

  /**
   * make properties from custom reference.conf file with fallback on defaults
   */
  public static Map<String, String> propsFrom(final File file) {

    final Config root = ConfigFactory.parseFile(file)
        .withFallback(ConfigHelp.reference()).resolve();

    return propsFrom(root);

  }
View Full Code Here

    /** For use ONLY by library internals, DO NOT TOUCH not guaranteed ABI */
    public static Config defaultReference(final ClassLoader loader) {
        return computeCachedConfig(loader, "defaultReference", new Callable<Config>() {
            @Override
            public Config call() {
                Config unresolvedResources = Parseable
                        .newResources("reference.conf",
                                ConfigParseOptions.defaults().setClassLoader(loader))
                        .parse().toConfig();
                return systemPropertiesAsConfig().withFallback(unresolvedResources).resolve();
            }
View Full Code Here

TOP

Related Classes of com.typesafe.config.Config

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.