Search in sources :

Example 1 with ServiceLocation

use of org.apache.ofbiz.service.config.model.ServiceLocation in project ofbiz-framework by apache.

the class AbstractEngine method createLocationMap.

// creates the location alias map
protected static Map<String, String> createLocationMap() {
    Map<String, String> tmpMap = new HashMap<>();
    List<ServiceLocation> locationsList = null;
    try {
        locationsList = ServiceConfigUtil.getServiceEngine().getServiceLocations();
    } catch (GenericConfigException e) {
        // FIXME: Refactor API so exceptions can be thrown and caught.
        Debug.logError(e, module);
        throw new RuntimeException(e.getMessage());
    }
    for (ServiceLocation e : locationsList) {
        tmpMap.put(e.getName(), e.getLocation());
    }
    Debug.logInfo("Loaded Service Locations: " + tmpMap, module);
    return Collections.unmodifiableMap(tmpMap);
}
Also used : GenericConfigException(org.apache.ofbiz.base.config.GenericConfigException) HashMap(java.util.HashMap) ServiceLocation(org.apache.ofbiz.service.config.model.ServiceLocation)

Aggregations

HashMap (java.util.HashMap)1 GenericConfigException (org.apache.ofbiz.base.config.GenericConfigException)1 ServiceLocation (org.apache.ofbiz.service.config.model.ServiceLocation)1