private < T > T getConfig ( final Class < T > configClass ) throws ConfigurationException { Iterator < Name > it = getServicePath ( ) . descendingPathIterator ( ) ; while ( it . hasNext ( ) ) { try ( InputStream in = getConfigurationStream ( configClass , it . next ( ) ) ) { return decoder . deserialise ( in , configClass ) ; } catch ( final ConfigurationException e ) { LOG . trace ( "No configuration at this path level" , e ) ; } catch ( final CodecException | IOException e ) { incrementErrors ( ) ; throw new ConfigurationException ( "Failed to get configuration for " + configClass . getSimpleName ( ) , e ) ; } } incrementErrors ( ) ; throw new ConfigurationException ( "No configuration found for " + configClass . getSimpleName ( ) ) ; }
Acquire decode and decrypt a configuration object from a data stream .