@ Override public Service get ( ) { String serviceName = this . environment . getVariable ( SERVICE_NAME_KEY ) ; if ( Strings . isNullOrEmpty ( serviceName ) ) { String errorMessage = String . format ( "Environment variable '%s' is not set" , SERVICE_NAME_KEY ) ; throw new IllegalArgumentException ( errorMessage ) ; } String serviceVersion = this . environment . getVariable ( SERVICE_VERSION_KEY ) ; return fetch ( serviceName , serviceVersion ) ; }
Fetches the service configuration using the service name and the service version read from the environment variables .