in iep-spring-aws2/src/main/java/com/netflix/iep/aws2/AwsClientFactory.java [237:257]
private SdkHttpService createSyncHttpService(Config clientConfig) {
if (clientConfig.hasPath("sync-http-impl")) {
String clsName = clientConfig.getString("sync-http-impl");
try {
Class<?> clientClass = Class.forName(clsName);
return (SdkHttpService) clientClass.getConstructor().newInstance();
} catch (Exception e) {
throw new RuntimeException("failed to create instance of " + clsName, e);
}
} else {
Iterator<SdkHttpService> services = ServiceLoader
.load(SdkHttpService.class)
.iterator();
if (services.hasNext()) {
return services.next();
} else {
throw new IllegalStateException("could not find SdkHttpService on classpath, " +
"set `sync-http-impl` to specify the implementation to use");
}
}
}