Module java.money

Interface ExchangeRateProvider


public interface ExchangeRateProvider
This interface defines access to the exchange rates provided by a provider. The provider and its capabilities can be defined in arbitrary detail by the corresponding ProviderContext. Instances of this class must only provide conversion data for exact one provider, identified by AbstractContext.getProviderName(). When accessing ExchangeRateProvider instances or CurrencyConversion instances from the MonetaryConversions in many cases a chain of providers will be returned. It is the responsibility of the implementation code assembling the chain to establish a well defined coordination mechanism for evaluating the correct result. By default the first provider in the chain that returns a non null result determines the final result of a call. Nevertheless adapting the MonetaryConversionsSingletonSpi allows to implement also alternate strategies, e.g. honoring different priorities of providers as well.

Implementations of this interface are required to be thread save.

Implementations of this class must neither be immutable nor serializable.

Author:
Anatole Tresch, Werner Keil