当前位置: 首页>>代码示例>>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;未经允许,请勿转载。