public final class LocalServices extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
addService(Class<T> type,
T service)
Adds a service instance of the specified interface to the global registry of local services.
|
static <T> T |
getService(Class<T> type)
Returns a local service instance that implements the specified interface.
|
static <T> void |
removeServiceForTest(Class<T> type)
Remove a service instance, must be only used in tests.
|
public static <T> T getService(Class<T> type)
type
- The type of service.public static <T> void addService(Class<T> type, T service)
public static <T> void removeServiceForTest(Class<T> type)