當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。