private static String getServiceHostAndPort ( String serviceName , String defaultHost , String defaultPort ) { String serviceEnvVarPrefix = getServiceEnvVarPrefix ( serviceName ) ; String hostEnvVar = serviceEnvVarPrefix + "_HOST" ; String portEnvVar = serviceEnvVarPrefix + "_PORT" ; String host = getEnvVarOrSystemProperty ( hostEnvVar , hostEnvVar , defaultHost ) ; String port = getEnvVarOrSystemProperty ( portEnvVar , portEnvVar , defaultPort ) ; String answer = host + ":" + port ; return answer ; }
Returns the service host and port for the given environment variable name .