Package models.utils

Source Code of models.utils.DistributedUtils

/* 

Copyright [2013-2014] eBay Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

*/
package models.utils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.typesafe.config.Config;
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));
    }
  }
}
TOP

Related Classes of models.utils.DistributedUtils

TOP
Copyright © 2018 www.massapi.com. 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.