Top Description Methods
javax.money.spi

public Interface ServiceProvider

Known Direct Implementers
javax.money.spi.DefaultServiceProvider
Imports
java.util.List

This class models the component that is managing the lifecycle of the monetary services used by the Money and Currency API.
Authors
Anatole Tresch, Werner Keil

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the provider's priority (default is 0).
getPriority
()

This method allows to define a priority for a registered ServiceProvider instance.

public default <T> T

Returns:

The instance, (with highest precedence) or null, if no such service is available.
getService
(Class<T>
the service type.
serviceType
)

Access a single service, given its type.

public <T> List<T>

Returns:

The instance to be used, never null
getServices
(Class<T>
the service type.
serviceType
)

Access a list of services, given its type.

Method Detail

getPriorityback to summary
public int getPriority()

This 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.

Returns:int

the provider's priority (default is 0).

getServiceback to summary
public default <T> T getService(Class<T> serviceType)

Access a single service, given its type. The bootstrap mechanism should order the instance for precedence, hereby the most significant should be first in order and returned. If no such services are found, null is returned.

Parameters
serviceType:Class<T>

the service type.

Returns:T

The instance, (with highest precedence) or null, if no such service is available.

getServicesback to summary
public <T> List<T> getServices(Class<T> serviceType)

Access a list of services, given its type. The bootstrap mechanism should order the instance for precedence, hereby the most significant should be first in order. If no such services are found, an empty list should be returned.

Parameters
serviceType:Class<T>

the service type.

Returns:List<T>

The instance to be used, never null