本文整理汇总了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;
}