java.lang.Object
javax.money.spi.DefaultServiceProvider
- All Implemented Interfaces:
ServiceProvider
This class implements the (default)
ServiceProvider interface and hereby uses the JDK
ServiceLoader to load the services required.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentHashMap<Class<?>, List<Object>> List of services loaded, per class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThis method allows to define a priority for a registered ServiceProvider instance.<T> List<T> getServices(Class<T> serviceType) Loads and registers services.private <T> List<T> loadServices(Class<T> serviceType) Loads and registers services.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.money.spi.ServiceProvider
getService
-
Field Details
-
servicesLoaded
List of services loaded, per class.
-
-
Constructor Details
-
DefaultServiceProvider
DefaultServiceProvider()
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:ServiceProviderThis method allows to define a priority for a registered ServiceProvider instance. When multiple providers are registered in the system the provider with the highest priority value is taken.- Specified by:
getPriorityin interfaceServiceProvider- Returns:
- the provider's priority (default is 0).
-
getServices
Loads and registers services.- Specified by:
getServicesin interfaceServiceProvider- Type Parameters:
T- the concrete type.- Parameters:
serviceType- The service type.- Returns:
- the items found, never
null.
-
loadServices
Loads and registers services.- Type Parameters:
T- the concrete type.- Parameters:
serviceType- The service type.- Returns:
- the items found, never
null.
-