Top Description Fields Constructors Methods
org.javamoney.moneta.spi

public Class PriorityAwareServiceProvider

extends Object
implements ServiceProvider
Class Inheritance
All Implemented Interfaces
javax.money.spi.ServiceProvider
Imports
jakarta.annotation.Priority, javax.money.Monetary, javax.money.spi.ServiceProvider, java.util.ArrayList, .Collections, .List, .ServiceLoader, java.util.concurrent.ConcurrentHashMap, java.util.logging.Level, .Logger

This class implements the (default) javax.money.spi.ServiceProvider interface and hereby uses the JDK java.util.ServiceLoader to load the services required.
Authors
Anatole Tresch, Werner Keil

Field Summary

Modifier and TypeField and Description
private final ConcurrentHashMap<Class<?>, List<Object>>
servicesLoaded

List of services loaded, per class.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int
public int

Returns:

10, overriding the default provider.
getPriority
()

Implements javax.money.spi.ServiceProvider.getPriority.

Returns a priority value of 10.

public <
the concrete type.
T
>
List<T>

Returns:

the items found, never null.
getServices
(final Class<T>
The service type.
serviceType
)

Implements javax.money.spi.ServiceProvider.getServices.

Loads and registers services.

private <
the concrete type.
T
>
List<T>

Returns:

the items found, never null.
loadServices
(final Class<T>
The service type.
serviceType
)

Loads and registers services.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

servicesLoadedback to summary
private final ConcurrentHashMap<Class<?>, List<Object>> servicesLoaded

List of services loaded, per class.

Constructor Detail

PriorityAwareServiceProviderback to summary
public PriorityAwareServiceProvider()

Method Detail

compareServicesback to summary
public static int compareServices(Object o1, Object o2)
getPriorityback to summary
public int getPriority()

Implements javax.money.spi.ServiceProvider.getPriority.

Returns a priority value of 10.

Returns:int

10, overriding the default provider.

Annotations
@Override
getServicesback to summary
public <T> List<T> getServices(final Class<T> serviceType)

Implements javax.money.spi.ServiceProvider.getServices.

Loads and registers services.

Parameters
<T>
the concrete type.
serviceType:Class<T>

The service type.

Returns:List<T>

the items found, never null.

Annotations
@Override
loadServicesback to summary
private <T> List<T> loadServices(final Class<T> serviceType)

Loads and registers services.

Parameters
<T>
the concrete type.
serviceType:Class<T>

The service type.

Returns:List<T>

the items found, never null.