final ServiceLoader<CDILoader> serviceLoader = ServiceLoader.load(CDILoader.class);
final Iterator<CDILoader> loaderIterator = serviceLoader.iterator();
if (!loaderIterator.hasNext()) {
throw new IllegalStateException("No CDI Loader implementation for JavaFX could be found on your classpath.");
}
final CDILoader loader = loaderIterator.next();
if (loaderIterator.hasNext()) {
throw new IllegalStateException("More than one CDI Loader implementation for JavaFX could be found on your classpath.");
}
this.fxCdiLoader = loader;