Examples of ModuleMetadata


Examples of org.terasology.module.ModuleMetadata

        metadataReader.registerExtension(SERVER_SIDE_ONLY_EXT, Boolean.TYPE);
        metadataReader.registerExtension(IS_GAMEPLAY_EXT, Boolean.TYPE);
        metadataReader.registerExtension(DEFAULT_WORLD_GENERATOR_EXT, String.class);
        Module engineModule;
        try (Reader reader = new InputStreamReader(getClass().getResourceAsStream("/engine-module.txt"))) {
            ModuleMetadata metadata = metadataReader.read(reader);
            engineModule = ClasspathModule.create(metadata, getClass(), Module.class);
        } catch (IOException e) {
            throw new RuntimeException("Failed to read engine metadata", e);
        } catch (URISyntaxException e) {
            throw new RuntimeException("Failed to convert engine library location to path", e);
View Full Code Here

Examples of org.wso2.carbon.module.mgt.ModuleMetaData

            if (SystemFilter.isFilteredOutModule(axisModule)) {
                continue;
            }

            if (axisModule.getName() != null) {
                ModuleMetaData moduleMetaData = populateModuleMetaData(axisModule);
                moduleList.add(moduleMetaData);
            }
        }

        return moduleList.toArray(new ModuleMetaData[moduleList.size()]);
View Full Code Here

Examples of org.wso2.carbon.module.mgt.ModuleMetaData

            if (SystemFilter.isFilteredOutModule(axisModule)) {
                continue;
            }

            if (axisConfig.isEngaged(moduleId)) {
                emodules.add(new ModuleMetaData(axisModule.getName(), moduleVersion));
                continue;
            }

            Parameter param = axisModule.getParameter(GLOBALLY_ENGAGED_PARAM_NAME);
            if (param != null) {
                String globallyEngaged = (String) param.getValue();
                if (globallyEngaged != null && globallyEngaged.length() != 0
                        && Boolean.parseBoolean(globallyEngaged.trim())) {
                    emodules.add(new ModuleMetaData(axisModule.getName(), moduleVersion));
                }
            }
        }

        return emodules.toArray(new ModuleMetaData[emodules.size()]);
View Full Code Here

Examples of org.wso2.carbon.module.mgt.ModuleMetaData

    }

    private ModuleMetaData populateModuleMetaData(AxisModule axisModule) {

        ModuleMetaData moduleMetaData = new ModuleMetaData();

        String moduleVersion = "";
        if (axisModule.getVersion() != null) {
            moduleVersion = axisModule.getVersion().toString();
        }

        moduleMetaData.setModulename(axisModule.getName());
        moduleMetaData.setModuleVersion(moduleVersion);
        moduleMetaData.setModuleId(getModuleId(axisModule.getName(), axisModule.getVersion()));
        moduleMetaData.setEngagedGlobalLevel(axisConfig.isEngaged(axisModule));

        //Some moduels like caching, throtteling use "globallyEngaged" parameter, to engage themself globally without
        //affecting the admin services
        Parameter param = axisModule.getParameter(GLOBALLY_ENGAGED_PARAM_NAME);
        if (param != null) {
            String globallyEngaged = (String) param.getValue();
            if (globallyEngaged != null && globallyEngaged.length() != 0
                        && Boolean.parseBoolean(globallyEngaged.trim())) {
                    moduleMetaData.setEngagedGlobalLevel(true);
            }
        }

        // Set whether this is a system managed module, like throtelling, caching
        moduleMetaData.setManagedModule(SystemFilter.isManagedModule(axisModule));

        String description = axisModule.getModuleDescription();

        //TODO this logic needs to go in to UI
        if (description != null) {
            moduleMetaData.setDescription(description);
        } else {
            moduleMetaData.setDescription("No description found");
        }

        return moduleMetaData;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.