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


Java EntityEcaReader類代碼示例

本文整理匯總了Java中org.ofbiz.entity.config.model.EntityEcaReader的典型用法代碼示例。如果您正苦於以下問題:Java EntityEcaReader類的具體用法?Java EntityEcaReader怎麽用?Java EntityEcaReader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntityEcaReader類屬於org.ofbiz.entity.config.model包,在下文中一共展示了EntityEcaReader類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readConfig

import org.ofbiz.entity.config.model.EntityEcaReader; //導入依賴的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

示例2: getEntityEcaReader

import org.ofbiz.entity.config.model.EntityEcaReader; //導入依賴的package包/類
public static EntityEcaReader getEntityEcaReader(String name) throws GenericEntityConfException {
    return getEntityConfig().getEntityEcaReader(name);
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:4,代碼來源:EntityConfigUtil.java


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