Class SimpleServiceLoader


  • public final class SimpleServiceLoader
    extends Object
    A replacement for ServiceLoader that avoids certain long-standing bugs. This simpler implementation does not bother with lazy loading but returns all the service implementations in one list. It makes sure that URLConnection.setUseCaches(boolean) is called to turn off jar caching, since that tends to lead to problems in versions before JDK 9.
    See Also:
    Issue #718, JDK-8156014
    • Method Detail

      • load

        public static <T> com.google.common.collect.ImmutableList<T> load​(Class<? extends T> service,
                                                                          ClassLoader loader)
      • load

        public static <T> com.google.common.collect.ImmutableList<T> load​(Class<? extends T> service,
                                                                          ClassLoader loader,
                                                                          Optional<Pattern> allowedMissingClasses)