本文整理匯總了Java中org.javamoney.moneta.spi.LoaderService類的典型用法代碼示例。如果您正苦於以下問題:Java LoaderService類的具體用法?Java LoaderService怎麽用?Java LoaderService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LoaderService類屬於org.javamoney.moneta.spi包,在下文中一共展示了LoaderService類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LanguageTranslations
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
public LanguageTranslations(String language)
throws MalformedURLException, URISyntaxException {
LoaderService loader = Bootstrap.getService(LoaderService.class);
URL backupUrl = CLDRTranslations.class.getResource(
"java-money/defaults/cldr/main/" + language
+ ".xml");
URI backupURI = backupUrl == null ? null : backupUrl.toURI();
loader.registerAndLoadData(
"CLDR-Translations_" + language,
UpdatePolicy.ONSTARTUP,
new HashMap<String, String>(),
this,
backupURI,
new URI("http://unicode.org/repos/cldr/trunk/common/main/"
+ language + ".xml"));
}
示例2: IMFRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
public IMFRateProvider() {
super(CONTEXT);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, DATA_ID);
try {
loader.loadData(DATA_ID);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Error loading initial data from IMF provider...", e);
}
}
示例3: ECBAbstractRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
public ECBAbstractRateProvider(ProviderContext context) {
super(context);
saxParserFactory.setNamespaceAware(false);
saxParserFactory.setValidating(false);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, getDataId());
loader.loadDataAsync(getDataId());
}
示例4: CLDRCurrencyRegionData
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
private CLDRCurrencyRegionData() throws MalformedURLException {
Bootstrap.getService(LoaderService.class).addLoaderListener(this, "CLDR-SupplementalData");
try {
Bootstrap.getService(LoaderService.class).loadData("CLDR-SupplementalData");
} catch (IOException e) {
LOG.log(Level.SEVERE, "Error loading CLDR supplemental data.", e);
}
}
示例5: initalize
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
private void initalize() {
saxParserFactory.setNamespaceAware(false);
saxParserFactory.setValidating(false);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, getDataId());
try {
loader.loadDataAsync(getDataId());
} catch(Exception e) {
throw new RuntimeException(e);
}
}
示例6: YahooAbstractRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
YahooAbstractRateProvider(ProviderContext context) {
super(context);
this.context = context;
final LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, getDataId());
loader.loadDataAsync(getDataId());
}
示例7: ECBAbstractRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
ECBAbstractRateProvider(ProviderContext context) {
super(context);
this.context = context;
saxParserFactory.setNamespaceAware(false);
saxParserFactory.setValidating(false);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, getDataId());
loader.loadDataAsync(getDataId());
}
示例8: IMFRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
public IMFRateProvider() {
super(CONTEXT);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, DATA_ID);
try {
loader.loadData(DATA_ID);
} catch (IOException e) {
LOG.log(Level.WARNING, "Error loading initial data from IMF provider...", e);
}
}
示例9: IMFHistoricRateProvider
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
public IMFHistoricRateProvider() {
super(CONTEXT);
LoaderService loader = Bootstrap.getService(LoaderService.class);
loader.addLoaderListener(this, DATA_ID);
try {
loader.loadData(DATA_ID);
} catch (IOException e) {
LOG.log(Level.WARNING, "Error loading initial data from IMF provider...", e);
}
}
示例10: LoaderConfigurator
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
LoaderConfigurator(LoaderService loaderService) {
Objects.requireNonNull(loaderService);
this.loaderService = loaderService;
}
示例11: shouldReadDataFromFallback
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
private boolean shouldReadDataFromFallback() {
return LoaderService.UpdatePolicy.NEVER.equals(updatePolicy) || !loadRemote();
}
示例12: getUpdatePolicy
import org.javamoney.moneta.spi.LoaderService; //導入依賴的package包/類
/**
* Get the UpdatePolicy of this resource.
*
* @return the UpdatePolicy of this resource, never null.
*/
public LoaderService.UpdatePolicy getUpdatePolicy() {
return updatePolicy;
}