当前位置: 首页>>代码示例>>Java>>正文


Java ComponentConfig.getAllComponents方法代码示例

本文整理汇总了Java中org.ofbiz.base.component.ComponentConfig.getAllComponents方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentConfig.getAllComponents方法的具体用法?Java ComponentConfig.getAllComponents怎么用?Java ComponentConfig.getAllComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ofbiz.base.component.ComponentConfig的用法示例。


在下文中一共展示了ComponentConfig.getAllComponents方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepareAll

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public void prepareAll() throws GeneralException {
    Debug.logInfo("Loading artifact info objects...", module);
    List<Future<Void>> futures = new ArrayList<Future<Void>>();
    Set<String> entityNames = this.getEntityModelReader().getEntityNames();
    for (String entityName: entityNames) {
        this.getEntityArtifactInfo(entityName);
    }

    Set<String> serviceNames = this.getDispatchContext().getAllServiceNames();
    for (String serviceName: serviceNames) {
        futures.add(ExecutionPool.GLOBAL_FORK_JOIN.submit(prepareTaskForServiceAnalysis(serviceName)));
    }
    // how to get all Service ECAs to prepare? don't worry about it, will be populated from service load, ie all ECAs for each service

    Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
    ExecutionPool.getAllFutures(futures);
    futures = new ArrayList<Future<Void>>();
    for (ComponentConfig componentConfig: componentConfigs) {
        futures.add(ExecutionPool.GLOBAL_FORK_JOIN.submit(prepareTaskForComponentAnalysis(componentConfig)));
    }
    ExecutionPool.getAllFutures(futures);
    Debug.logInfo("Artifact info objects loaded.", module);
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:24,代码来源:ArtifactInfoFactory.java

示例2: startFileListener

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
/**
 * A service used to capture file changes on the system. Automatically implements file listeners for all components recursively.
 * 
 * @param dctx The DispatchContext that this service is operating in
 * @param context Map containing the input parameters
 * @return Map with the result of the service, the output parameters
 */
public static Map<String, Object> startFileListener(DispatchContext dctx, Map<String, ?> context) {
    //Delegator delegator = dctx.getDelegator();
    //LocalDispatcher dispatcher = dctx.getDispatcher();
    try {
        Collection<ComponentConfig> allComponents = ComponentConfig.getAllComponents();
        for (ComponentConfig config : allComponents) {
            String name = "component-"+config.getComponentName();
            String location = config.getRootLocation();
            FileListener.startFileListener(name,location); 
        }
        return ServiceUtil.returnSuccess("File event registered.");
    }
    catch(Exception e) {
        final String errorMsg = "Exception triggering File Event";
        Debug.logError(e, errorMsg, module);
        return ServiceUtil.returnError(errorMsg + ": " + e.getMessage());
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:26,代码来源:CommonServices.java

示例3: prepareAll

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public void prepareAll() throws GeneralException {
    Debug.logInfo("Loading artifact info objects...", module);
    List<Future<Void>> futures = new ArrayList();
    Set<String> entityNames = this.getEntityModelReader().getEntityNames();
    for (String entityName: entityNames) {
        this.getEntityArtifactInfo(entityName);
    }

    Set<String> serviceNames = this.getDispatchContext().getAllServiceNames();
    for (String serviceName: serviceNames) {
        futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(prepareTaskForServiceAnalysis(serviceName)));
    }
    // how to get all Service ECAs to prepare? don't worry about it, will be populated from service load, ie all ECAs for each service

    Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
    ExecutionPool.getAllFutures(futures);
    futures = new ArrayList();
    for (ComponentConfig componentConfig: componentConfigs) {
        futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(prepareTaskForComponentAnalysis(componentConfig)));
    }
    ExecutionPool.getAllFutures(futures);
    Debug.logInfo("Artifact info objects loaded.", module);
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:24,代码来源:ArtifactInfoFactory.java

示例4: getComponentInfos

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
/**
 * Return a list of Maps containing all component/webapp informations
 *
 * @param webSiteIds only include trees for these webSiteIds
 */
public static List<Map<String, Object>> getComponentInfos(Set<String> webSiteIds) {
    Collection<ComponentConfig> components = ComponentConfig.getAllComponents();
    List<Map<String, Object>> componentList = FastList.newInstance();

    for (ComponentConfig component : components) {
        List<WebappInfo> webApps = component.getWebappInfos();
        for (WebappInfo webApp : webApps) {
            Map<String, Object> newMap = getWebAppInfo(component, webApp);
            if (newMap != null && (webSiteIds == null || webSiteIds.contains(newMap.get("webSiteId"))))
                componentList.add(newMap);
        }
    }
    return componentList;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:20,代码来源:ComponentUtil.java

示例5: findRealPathAndFileForClass

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public static String findRealPathAndFileForClass(String fullyQualifiedClassName) {
    // search through the component directories, in the src directory for each, using the class path as the path within it

    String sourceSubPath = fullyQualifiedClassName.substring(0, fullyQualifiedClassName.lastIndexOf(".")).replace('.', File.separatorChar);
    String classFileName = fullyQualifiedClassName.substring(fullyQualifiedClassName.lastIndexOf(".")+1) + ".java";

    Collection<ComponentConfig> allComponentConfigs = ComponentConfig.getAllComponents();
    for (ComponentConfig cc: allComponentConfigs) {
        String rootDirectory = cc.getRootLocation();
        if (!rootDirectory.endsWith(File.separatorChar + "")) rootDirectory += File.separatorChar;
        rootDirectory += "src" + File.separatorChar;

        File rootDirFile = new File(rootDirectory);
        if (!rootDirFile.exists()) {
            // no src directory, move along
            continue;
        }

        String classDir = rootDirectory + sourceSubPath;
        File classDirFile = new File(classDir);
        if (!classDirFile.exists()) {
            // no src class sub-directory, move along
            continue;
        }

        String fullPathAndFile = classDir + File.separatorChar + classFileName;
        File classFile = new File(fullPathAndFile);
        if (classFile.exists()) {
            if (Debug.verboseOn()) Debug.logVerbose("In findRealPathAndFileForClass for [" + fullyQualifiedClassName + "]: [" + fullPathAndFile + "]", module);
            return fullPathAndFile;
        }
    }

    return null;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:36,代码来源:UtilJavaParse.java

示例6: loadComponentNames

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
protected static void loadComponentNames() {
    componentNamesFound = new TreeSet<String>();
    Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
    for (ComponentConfig componentConfig : componentConfigs) {
        componentNamesFound.add(componentConfig.getComponentName());
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:LabelManagerFactory.java

示例7: LabelReferences

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public LabelReferences(Delegator delegator, LabelManagerFactory factory) {
    this.delegator = delegator;
    this.labels = factory.getLabels();
    DelegatorElement delegatorInfo = null;
    try {
        delegatorInfo = EntityConfig.getInstance().getDelegator(delegator.getDelegatorBaseName());
    } catch (GenericEntityConfException e) {
        Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
    }
    String modelName;
    if (delegatorInfo != null) {
        modelName = delegatorInfo.getEntityModelReader();
    } else {
        modelName = "main";
    }
    // since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
    // in this way it will be possible to retrieve the service models from the cache
    this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
    Collection<LabelInfo> infoList = this.labels.values();
    for (LabelInfo labelInfo : infoList) {
        this.labelSet.add(labelInfo.getLabelKey());
    }
    Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
    for (ComponentConfig config : componentConfigs) {
        String rootFolder = config.getRootLocation();
        rootFolder = rootFolder.replace('\\', '/');
        if (!rootFolder.endsWith("/")) {
            rootFolder = rootFolder + "/";
        }
        this.rootFolders.add(rootFolder);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:33,代码来源:LabelReferences.java

示例8: LabelReferences

import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public LabelReferences(Delegator delegator, LabelManagerFactory factory) {
    this.delegator = delegator;
    this.labels = factory.getLabels();
    DelegatorElement delegatorInfo = null;
    try {
        delegatorInfo = EntityConfigUtil.getDelegator(delegator.getDelegatorBaseName());
    } catch (GenericEntityConfException e) {
        Debug.logWarning(e, "Exception thrown while getting delegator config: ", module);
    }
    String modelName;
    if (delegatorInfo != null) {
        modelName = delegatorInfo.getEntityModelReader();
    } else {
        modelName = "main";
    }
    // since we do not associate a dispatcher to this DispatchContext, it is important to set a name of an existing entity model reader:
    // in this way it will be possible to retrieve the service models from the cache
    this.dispatchContext = new DispatchContext(modelName, this.getClass().getClassLoader(), null);
    Collection<LabelInfo> infoList = this.labels.values();
    for (LabelInfo labelInfo : infoList) {
        this.labelSet.add(labelInfo.getLabelKey());
    }
    Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents();
    for (ComponentConfig config : componentConfigs) {
        String rootFolder = config.getRootLocation();
        rootFolder = rootFolder.replace('\\', '/');
        if (!rootFolder.endsWith("/")) {
            rootFolder = rootFolder + "/";
        }
        this.rootFolders.add(rootFolder);
    }
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:33,代码来源:LabelReferences.java


注:本文中的org.ofbiz.base.component.ComponentConfig.getAllComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。