Package org.atlanmod.commons.service
Class ServiceProvider
- java.lang.Object
-
- org.atlanmod.commons.service.ServiceProvider
-
@ParametersAreNonnullByDefault public final class ServiceProvider extends Object
An object able to retrieve and load services according to aServiceContext.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServiceProvidergetInstance()Returns the instance of this class.<S> Stream<ServiceDefinition<S>>load(Class<S> type)Retrieves all registered services of the specifiedtype.
-
-
-
Method Detail
-
getInstance
@Nonnull public static ServiceProvider getInstance()
Returns the instance of this class.- Returns:
- the instance of this class
-
load
@Nonnull public <S> Stream<ServiceDefinition<S>> load(Class<S> type)
Retrieves all registered services of the specifiedtype.- Returns:
- a parallel stream of all registered services of the specified
type
-
-