public final class ServiceTypeLoader<T> extends Object implements Iterable<Class<? extends T>>
ServiceLoader
directly (before Java 9 which enhances it to support the use case Revapi needs).
This class is similar to ServiceLoader
but instead of providing instances of the service
implementations, it provides types of the service implementations. Users of this class are then responsible
for using these types anyway they want (instantiate them or whatever).
Modifier and Type | Method and Description |
---|---|
Iterator<Class<? extends T>> |
iterator() |
static <X> ServiceTypeLoader<X> |
load(Class<X> serviceType)
Locates the services in the context classloader of the current thread.
|
static <X> ServiceTypeLoader<X> |
load(Class<X> serviceType,
ClassLoader cl) |
void |
reload() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static <X> ServiceTypeLoader<X> load(Class<X> serviceType, ClassLoader cl)
public static <X> ServiceTypeLoader<X> load(Class<X> serviceType)
X
- the type of the serviceserviceType
- the type of the services to locatepublic void reload()
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.