package org.bench4q.web.masterMessager;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;


public class MasterAddressManamger {
	private static String masterAddress;
	private static final String CONFIG_FILE_NAME = "ipConfig.properties";
	private static final Properties prop = new Properties();
	static {
		String masterIpFilePath;
		try {
			masterIpFilePath =MasterAddressManamger.class.getClassLoader().getResource("")
					.toURI().getPath()
					+ CONFIG_FILE_NAME;
			FileInputStream inputStream = new FileInputStream(new File(
					masterIpFilePath));
			prop.load(inputStream);
			inputStream.close();
			masterAddress = prop.getProperty("masterAddress");
		} catch (Exception e1) {
			masterAddress = "133.133.12.1:7979";
		}

	}

	public static String getMasterAddress() {
		return masterAddress;
	}

}
