Package org.lilyproject.runtime.conf

Examples of org.lilyproject.runtime.conf.Conf


    private LilyRuntimeModel buildModel(ConfRegistry confRegistry) {
        LilyRuntimeModel newModel;
        if ((settings.getModel() != null)) {
            newModel = settings.getModel();
        } else {
            Conf modulesConf = confRegistry.getConfiguration("wiring", false, false);
            Set<String> disabledModuleIds = settings.getDisabledModuleIds() != null ?
                    settings.getDisabledModuleIds() : Collections.<String>emptySet();
            SourceLocations sourceLocations = settings.getSourceLocations() != null ?
                    settings.getSourceLocations() : new SourceLocations();
            try {
View Full Code Here


            ModuleConfig moduleConf = ModuleConfigBuilder.build(entry, this);
            moduleConfigs.add(moduleConf);
        }

        // Check / build class path configurations
        Conf classLoadingConf = confRegistry.getConfiguration("classloading");
        List<ClasspathEntry> sharedClasspath = ClassLoaderConfigurer.configureClassPaths(moduleConfigs,
                settings.getEnableArtifactSharing(), classLoadingConf);

        // Construct the shared classloader
        infolog.debug("Creating shared classloader");
View Full Code Here

    private ClassLoaderConfigurer(List<ModuleConfig> moduleConfigs, boolean enableSharing, Conf classLoadingConf) {
        this.moduleConfigs = moduleConfigs;
        this.enableSharing = enableSharing;

        Conf requiredConf = classLoadingConf.getChild("required", false);
        Conf allowedConf = classLoadingConf.getChild("allowed", false);

        if (requiredConf != null) {
            String requiredSharingStr = requiredConf.getAttribute("on-conflict", requiredSharingConflictResolution.getName());
            requiredSharingConflictResolution = SharingConflictResolution.fromString(requiredSharingStr);
            if (requiredSharingConflictResolution == null || requiredSharingConflictResolution.equals(SharingConflictResolution.DONTSHARE)) {
                throw new LilyRTException("Illegal value for required sharing conflict resolution (@on-conflict: " + requiredSharingStr, requiredConf.getLocation());
            }
        }

        if (allowedConf != null) {
            String allowedSharingStr = allowedConf.getAttribute("on-conflict", allowedSharingConflictResolution.getName());
            allowedSharingConflictResolution = SharingConflictResolution.fromString(allowedSharingStr);
            if (allowedSharingConflictResolution == null) {
                throw new LilyRTException("Illegal value for allowed sharing conflict resolution (@on-conflict:  " + allowedSharingStr, requiredConf.getLocation());
            }
        }
View Full Code Here

     * @param qName to test
     */
    public ConfAttributeIterator(NodePointer parent, QName qName) {
        this.parent = parent;

        Conf conf = (Conf)parent.getNode();

        String name = qName.getName();
        if (name.equals("*")) {
            attributes.addAll(conf.getAttributes().entrySet());
        } else {
            for (Map.Entry<String, String> entry : conf.getAttributes().entrySet()) {
                if (entry.getKey().equals(name)) {
                    attributes.add(entry);
                    break;
                }
            }
View Full Code Here

     * @param startWith starting pointer
     */
    public ConfNodeIterator(NodePointer parent, NodeTest nodeTest, NodePointer startWith) {
        this.parent = parent;

        Conf conf = (Conf) parent.getNode();
        for (Conf child : conf.getChildren()) {
            if (ConfNodePointer.testNode(child, nodeTest)) {
                children.add(child);
            }
        }

        if (startWith != null) {
            Conf wanted = (Conf)startWith.getNode();
            for (int i = 0; i < children.size(); i++) {
                if (children.get(i) == wanted) {
                    position = i + 1;
                    break;
                }
View Full Code Here

        try {
            String confPath = placeholder.substring(0, colonPos);
            String confExpr = placeholder.substring(colonPos + 1);

            Conf conf = confRegistry.getConfiguration(confPath);
            JXPathContext context = JXPathContext.newContext(conf);
            Object value = context.getValue(confExpr);

            return value == null ? "" : value.toString();
        } catch (Exception e) {
View Full Code Here

    private LilyRuntimeModelBuilder() {
    }

    public static LilyRuntimeModel build(File runtimeConfig, Set<String> disabledModuleIds,
            ArtifactRepository repository) throws Exception {
        Conf conf = XmlConfBuilder.build(runtimeConfig);
        return build(conf, disabledModuleIds, repository, new SourceLocations());
    }
View Full Code Here

        return build(conf, disabledModuleIds, repository, new SourceLocations());
    }

    public static LilyRuntimeModel build(File runtimeConfig, Set<String> disabledModuleIds,
            ArtifactRepository repository, SourceLocations artifactSourceLocations) throws Exception {
        Conf conf = XmlConfBuilder.build(runtimeConfig);
        return build(conf, disabledModuleIds, repository, artifactSourceLocations);
    }
View Full Code Here

    }

    private static void buildModules(List<ModuleDefinition> modules, Stack<String> wiringFileStack, Conf runtimeConf,
            ArtifactRepository repository, SourceLocations artifactSourceLocations) throws Exception {

        Conf modulesConf = runtimeConf.getRequiredChild("modules");
        List<Conf> importConfs = modulesConf.getChildren();
        for (Conf importConf : importConfs) {
            File fileToImport = null;
            ModuleSourceType sourceType = null;
            String version = "unknown";
            String id = null;
View Full Code Here

        if (wiringFileStack.contains(key)) {
            throw new LilyRTException("Recursive loading of wiring.xml-type file detected: " + key);
        }

        Conf conf = XmlConfBuilder.build(file);

        // go recursive
        wiringFileStack.push(key);
        buildModules(modules, wiringFileStack, conf, repository, artifactSourceLocations);
        wiringFileStack.pop();
View Full Code Here

TOP

Related Classes of org.lilyproject.runtime.conf.Conf

Copyright © 2018 www.massapicom. 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.