本文整理匯總了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);
}
}
}
示例2: getEntityEcaReader
import org.ofbiz.entity.config.model.EntityEcaReader; //導入依賴的package包/類
public static EntityEcaReader getEntityEcaReader(String name) throws GenericEntityConfException {
return getEntityConfig().getEntityEcaReader(name);
}