java.util · java.base · since Java 1.6
ServiceLoader
public final class ServiceLoader<S> implements Iterable<S>Discovers interface implementations registered via module `provides` clauses or META-INF/services files — plugin architecture without compile-time coupling.
Key methods
static <S> ServiceLoader<S> load(Class<S> service) | Find all providers on the class/module path. |
Optional<S> findFirst() | The first provider, if any. |
Stream<Provider<S>> stream() | Inspect provider types before instantiating. |