當前位置: 首頁>>代碼示例>>Java>>正文


Java ComponentConfig.getAllEntityResourceInfos方法代碼示例

本文整理匯總了Java中org.ofbiz.base.component.ComponentConfig.getAllEntityResourceInfos方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentConfig.getAllEntityResourceInfos方法的具體用法?Java ComponentConfig.getAllEntityResourceInfos怎麽用?Java ComponentConfig.getAllEntityResourceInfos使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.ofbiz.base.component.ComponentConfig的用法示例。


在下文中一共展示了ComponentConfig.getAllEntityResourceInfos方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ModelReader

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
private ModelReader(String modelName) throws GenericEntityException {
    this.modelName = modelName;
    entityResourceHandlers = new LinkedList<ResourceHandler>();
    resourceHandlerEntities = new HashMap<ResourceHandler, Collection<String>>();
    entityResourceHandlerMap = new HashMap<String, ResourceHandler>();

    EntityModelReader entityModelReaderInfo = EntityConfig.getInstance().getEntityModelReader(modelName);

    if (entityModelReaderInfo == null) {
        throw new GenericEntityConfException("Cound not find an entity-model-reader with the name " + modelName);
    }

    // get all of the main resource model stuff, ie specified in the entityengine.xml file
    for (Resource resourceElement : entityModelReaderInfo.getResourceList()) {
        ResourceHandler handler = new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation());
        entityResourceHandlers.add(handler);
    }

    // get all of the component resource model stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("model")) {
        if (modelName.equals(componentResourceInfo.readerName)) {
            entityResourceHandlers.add(componentResourceInfo.createResourceHandler());
        }
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:26,代碼來源:ModelReader.java

示例2: ModelGroupReader

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
public ModelGroupReader(String modelName) throws GenericEntityConfException {
    this.modelName = modelName;
    EntityGroupReader entityGroupReaderInfo = EntityConfig.getInstance().getEntityGroupReader(modelName);

    if (entityGroupReaderInfo == null) {
        throw new GenericEntityConfException("Cound not find an entity-group-reader with the name " + modelName);
    }
    for (Resource resourceElement: entityGroupReaderInfo.getResourceList()) {
        this.entityGroupResourceHandlers.add(new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()));
    }

    // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("group")) {
        if (modelName.equals(componentResourceInfo.readerName)) {
            this.entityGroupResourceHandlers.add(componentResourceInfo.createResourceHandler());
        }
    }

    // preload caches...
    getGroupCache();
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:22,代碼來源:ModelGroupReader.java

示例3: ModelReader

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
private ModelReader(String modelName) throws GenericEntityException {
    this.modelName = modelName;
    entityResourceHandlers = new LinkedList<ResourceHandler>();
    resourceHandlerEntities = new HashMap<ResourceHandler, Collection<String>>();
    entityResourceHandlerMap = new HashMap<String, ResourceHandler>();

    EntityModelReader entityModelReaderInfo = EntityConfigUtil.getEntityModelReader(modelName);

    if (entityModelReaderInfo == null) {
        throw new GenericEntityConfException("Cound not find an entity-model-reader with the name " + modelName);
    }

    // get all of the main resource model stuff, ie specified in the entityengine.xml file
    for (Resource resourceElement : entityModelReaderInfo.getResourceList()) {
        ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation());
        entityResourceHandlers.add(handler);
    }

    // get all of the component resource model stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("model")) {
        if (modelName.equals(componentResourceInfo.readerName)) {
            entityResourceHandlers.add(componentResourceInfo.createResourceHandler());
        }
    }
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:26,代碼來源:ModelReader.java

示例4: ModelGroupReader

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
public ModelGroupReader(String modelName) throws GenericEntityConfException {
    this.modelName = modelName;
    EntityGroupReader entityGroupReaderInfo = EntityConfigUtil.getEntityGroupReader(modelName);

    if (entityGroupReaderInfo == null) {
        throw new GenericEntityConfException("Cound not find an entity-group-reader with the name " + modelName);
    }
    for (Resource resourceElement: entityGroupReaderInfo.getResourceList()) {
        this.entityGroupResourceHandlers.add(new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, resourceElement.getLoader(), resourceElement.getLocation()));
    }

    // get all of the component resource group stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("group")) {
        if (modelName.equals(componentResourceInfo.readerName)) {
            this.entityGroupResourceHandlers.add(componentResourceInfo.createResourceHandler());
        }
    }

    // preload caches...
    getGroupCache();
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:22,代碼來源:ModelGroupReader.java

示例5: readConfig

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
protected static void readConfig(String entityEcaReaderName, Map<String, Map<String, List<EntityEcaRule>>> ecaCache) {
    EntityEcaReader entityEcaReaderInfo = null;
    try {
        entityEcaReaderInfo = EntityConfig.getInstance().getEntityEcaReader(entityEcaReaderName);
    } catch (GenericEntityConfException e) {
        Debug.logError(e, "Exception thrown while getting entity-eca-reader config with name: " + entityEcaReaderName, module);
    }
    if (entityEcaReaderInfo == null) {
        Debug.logError("BAD ERROR: Could not find entity-eca-reader config with name: " + entityEcaReaderName, module);
        return;
    }

    List<Future<List<EntityEcaRule>>> futures = new LinkedList<Future<List<EntityEcaRule>>>();
    for (Resource eecaResourceElement : entityEcaReaderInfo.getResourceList()) {
        ResourceHandler handler = new MainResourceHandler(EntityConfig.ENTITY_ENGINE_XML_FILENAME, eecaResourceElement.getLoader(), eecaResourceElement.getLocation());
        futures.add(ExecutionPool.GLOBAL_FORK_JOIN.submit(createEcaLoaderCallable(handler)));
    }

    // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("eca")) {
        if (entityEcaReaderName.equals(componentResourceInfo.readerName)) {
            futures.add(ExecutionPool.GLOBAL_FORK_JOIN.submit(createEcaLoaderCallable(componentResourceInfo.createResourceHandler())));
        }
    }

    for (List<EntityEcaRule> oneFileRules: ExecutionPool.getAllFutures(futures)) {
        for (EntityEcaRule rule: oneFileRules) {
            String entityName = rule.getEntityName();
            String eventName = rule.getEventName();
            Map<String, List<EntityEcaRule>> eventMap = ecaCache.get(entityName);
            List<EntityEcaRule> rules = null;
            if (eventMap == null) {
                eventMap = new HashMap<String, List<EntityEcaRule>>();
                rules = new LinkedList<EntityEcaRule>();
                ecaCache.put(entityName, eventMap);
                eventMap.put(eventName, rules);
            } else {
                rules = eventMap.get(eventName);
                if (rules == null) {
                    rules = new LinkedList<EntityEcaRule>();
                    eventMap.put(eventName, rules);
                }
            }
            rules.add(rule);
        }
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:48,代碼來源:EntityEcaUtil.java

示例6: readConfig

import org.ofbiz.base.component.ComponentConfig; //導入方法依賴的package包/類
protected static void readConfig(String entityEcaReaderName, Map<String, Map<String, List<EntityEcaRule>>> ecaCache) {
    EntityEcaReader entityEcaReaderInfo = null;
    try {
        entityEcaReaderInfo = EntityConfigUtil.getEntityEcaReader(entityEcaReaderName);
    } catch (GenericEntityConfException e) {
        Debug.logError(e, "Exception thrown while getting entity-eca-reader config with name: " + entityEcaReaderName, module);
    }
    if (entityEcaReaderInfo == null) {
        Debug.logError("BAD ERROR: Could not find entity-eca-reader config with name: " + entityEcaReaderName, module);
        return;
    }

    List<Future<List<EntityEcaRule>>> futures = FastList.newInstance();
    for (Resource eecaResourceElement : entityEcaReaderInfo.getResourceList()) {
        ResourceHandler handler = new MainResourceHandler(EntityConfigUtil.ENTITY_ENGINE_XML_FILENAME, eecaResourceElement.getLoader(), eecaResourceElement.getLocation());
        futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(createEcaLoaderCallable(handler)));
    }

    // get all of the component resource eca stuff, ie specified in each ofbiz-component.xml file
    for (ComponentConfig.EntityResourceInfo componentResourceInfo: ComponentConfig.getAllEntityResourceInfos("eca")) {
        if (entityEcaReaderName.equals(componentResourceInfo.readerName)) {
            futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(createEcaLoaderCallable(componentResourceInfo.createResourceHandler())));
        }
    }

    for (List<EntityEcaRule> oneFileRules: ExecutionPool.getAllFutures(futures)) {
        for (EntityEcaRule rule: oneFileRules) {
            String entityName = rule.getEntityName();
            String eventName = rule.getEventName();
            Map<String, List<EntityEcaRule>> eventMap = ecaCache.get(entityName);
            List<EntityEcaRule> rules = null;
            if (eventMap == null) {
                eventMap = FastMap.newInstance();
                rules = FastList.newInstance();
                ecaCache.put(entityName, eventMap);
                eventMap.put(eventName, rules);
            } else {
                rules = eventMap.get(eventName);
                if (rules == null) {
                    rules = FastList.newInstance();
                    eventMap.put(eventName, rules);
                }
            }
            rules.add(rule);
        }
    }
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:48,代碼來源:EntityEcaUtil.java


注:本文中的org.ofbiz.base.component.ComponentConfig.getAllEntityResourceInfos方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。