@Override protected boolean doInitialize(ResourceSpecifier specifier, Map<String, Object> additionalParams) throws ResourceInitializationException { ObjectMapper mapper = new ObjectMapper(); synchronized (this) { UimaMonitor monitor = getMonitor(); if (demonyms == null) { monitor.info("Shared country resource initialising"); JsonNode countriesJson = loadCountriesJson(mapper, monitor); countryNames = ImmutableMap.copyOf(loadCountryNames(countriesJson, monitor)); demonyms = ImmutableMap.copyOf(loadDemonyms(countriesJson, monitor)); geoJson = ImmutableMap.copyOf(loadCountriesGeoJson(mapper, monitor)); } else { monitor.info("Shared country resource already initialised"); } } return true; }
@Override protected boolean doInitialize(ResourceSpecifier specifier, Map<String, Object> additionalParams) throws ResourceInitializationException { ObjectMapper mapper = new ObjectMapper(); synchronized (this) { UimaMonitor monitor = getMonitor(); if (demonyms == null) { monitor.info("Shared country resource initialising"); JsonNode countriesJson = loadCountriesJson(mapper, monitor); countryNames = ImmutableMap.copyOf(loadCountryNames(countriesJson, monitor)); demonyms = ImmutableMap.copyOf(loadDemonyms(countriesJson, monitor)); geoJson = ImmutableMap.copyOf(loadCountriesGeoJson(mapper, monitor)); } else { monitor.info("Shared country resource already initialised"); } } return true; }