in appactive-java-client/client-support/src/main/java/io/appactive/support/spi/SpiUtil.java [27:42]
public static <T> T loadFirstInstance(Class<T> service){
ServiceLoader<T> load = ServiceLoader.load(service);
T currentService = null;
Iterator<T> iterator = load.iterator();
while(iterator.hasNext()) {
T ser = iterator.next();
currentService = ser;
if (currentService != null){
break;
}
}
if (currentService == null){
throw ExceptionFactory.makeFault("Load service failed,it is null:"+service.getName());
}
return currentService;
}