public static String getServiceName ( String hostname ) throws IOException { int i = hostname . lastIndexOf ( "." ) ; if ( i <= 0 ) { throw badHostName ( hostname ) ; } String service = hostname . substring ( i + 1 ) ; if ( service . isEmpty ( ) || service . contains ( "." ) ) { throw badHostName ( hostname ) ; } return service ; }
Extracts service name from the container . service