public final class Services extends Object
ServiceLoader. Decouples loading logic for
better separation of concerns and testability.| Modifier and Type | Method and Description |
|---|---|
static <T> T |
get(Class<T> spi)
Returns the first available implementation for the given SPI class, checking an internal thread-safe cache first,
and, if not found, using a
ServiceLoader to find implementations. |
static void |
reload()
Clears internal cache of service singletons.
|
public static <T> T get(Class<T> spi)
ServiceLoader to find implementations. When multiple implementations are
available it will return the first one that it encounters. There is no guarantee with regard to ordering.T - The type of the SPIspi - The class of the Service Provider InterfaceUnavailableImplementationException - When no implementation of the SPI class can be found.public static void reload()
Copyright © 2014–2024 jsonwebtoken.io. All rights reserved.