Search in sources :

Example 1 with ServiceGroups

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

the class ServiceGroupReader method readConfig.

public static void readConfig() {
    List<ServiceGroups> serviceGroupsList = null;
    try {
        serviceGroupsList = ServiceConfigUtil.getServiceEngine().getServiceGroups();
    } catch (GenericConfigException e) {
        // FIXME: Refactor API so exceptions can be thrown and caught.
        Debug.logError(e, module);
        throw new RuntimeException(e.getMessage());
    }
    for (ServiceGroups serviceGroup : serviceGroupsList) {
        ResourceHandler handler = new MainResourceHandler(ServiceConfigUtil.getServiceEngineXmlFileName(), serviceGroup.getLoader(), serviceGroup.getLocation());
        addGroupDefinitions(handler);
    }
    // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.ServiceResourceInfo componentResourceInfo : ComponentConfig.getAllServiceResourceInfos("group")) {
        addGroupDefinitions(componentResourceInfo.createResourceHandler());
    }
}
Also used : GenericConfigException(org.apache.ofbiz.base.config.GenericConfigException) MainResourceHandler(org.apache.ofbiz.base.config.MainResourceHandler) ComponentConfig(org.apache.ofbiz.base.component.ComponentConfig) ServiceGroups(org.apache.ofbiz.service.config.model.ServiceGroups) ResourceHandler(org.apache.ofbiz.base.config.ResourceHandler) MainResourceHandler(org.apache.ofbiz.base.config.MainResourceHandler)

Aggregations

ComponentConfig (org.apache.ofbiz.base.component.ComponentConfig)1 GenericConfigException (org.apache.ofbiz.base.config.GenericConfigException)1 MainResourceHandler (org.apache.ofbiz.base.config.MainResourceHandler)1 ResourceHandler (org.apache.ofbiz.base.config.ResourceHandler)1 ServiceGroups (org.apache.ofbiz.service.config.model.ServiceGroups)1