Package org.apache.cloudstack.spring.module.model

Examples of org.apache.cloudstack.spring.module.model.ModuleDefinition


            ((ConfigurableApplicationContext)base).registerShutdownHook();
        }
    }

    public ModuleDefinition getModuleDefinitionForWeb(String name) {
        ModuleDefinition def = moduleDefinitionSet.getModuleDefinition(name);

        if (def != null) {
            return def;
        }

        /* Grab farthest descendant that is deterministic */
        def = moduleDefinitionSet.getModuleDefinition(baseName);

        if (def == null) {
            throw new RuntimeException("Failed to find base spring module to extend for web");
        }

        while (def.getChildren().size() == 1) {
            def = def.getChildren().iterator().next();
        }

        return def;
    }
View Full Code Here


        return def;
    }

    public ApplicationContext getApplicationContextForWeb(String name) {
        ModuleDefinition def = getModuleDefinitionForWeb(name);

        return moduleDefinitionSet.getApplicationContext(def.getName());
    }
View Full Code Here

    public String[] getConfigLocationsForWeb(String name, String[] configured) {
        if (configured == null)
            configured = new String[] {};

        ModuleDefinition def = getModuleDefinitionForWeb(name);

        List<Resource> inherited = new ArrayList<Resource>();

        while (def != null) {
            inherited.addAll(def.getInheritableContextLocations());
            def = moduleDefinitionSet.getModuleDefinition(def.getParentName());
        }

        List<String> urlList = new ArrayList<String>();

        for (Resource r : inherited) {
View Full Code Here

        for (ModuleDefinition def : defs) {
            modules.put(def.getName(), def);
        }

        ModuleDefinition rootDef = null;
        Map<String, ModuleDefinition> result = new HashMap<String, ModuleDefinition>();

        for (ModuleDefinition def : modules.values()) {
            if (def.getName().equals(root)) {
                rootDef = def;
            }

            if (def.getParentName() != null) {
                ModuleDefinition parentDef = modules.get(def.getParentName());

                if (parentDef != null)
                    parentDef.addChild(def);
            }
        }

        return traverse(rootDef, result);
    }
View Full Code Here

        loadContexts();
        startContexts();
    }

    protected boolean loadRootContext() {
        ModuleDefinition def = modules.get(root);

        if (def == null)
            return false;

        ApplicationContext defaultsContext = getDefaultsContext();
View Full Code Here

            }
        });
    }

    protected void withModule(WithModule with) {
        ModuleDefinition rootDef = modules.get(root);
        withModule(rootDef, new Stack<ModuleDefinition>(), with);
    }
View Full Code Here

    @Override
    public Resource[] getConfigResources(String name) {
        Set<Resource> resources = new LinkedHashSet<Resource>();

        ModuleDefinition original = null;
        ModuleDefinition def = original = modules.get(name);

        if (def == null)
            return new Resource[] {};

        resources.addAll(def.getContextLocations());

        while (def != null) {
            resources.addAll(def.getInheritableContextLocations());
            def = modules.get(def.getParentName());
        }

        resources.addAll(original.getOverrideContextLocations());

        return resources.toArray(new Resource[resources.size()]);
View Full Code Here

       
        for ( ModuleDefinition def : defs ) {
            modules.put(def.getName(), def);
        }
       
        ModuleDefinition rootDef = null;
        Map<String, ModuleDefinition> result = new HashMap<String, ModuleDefinition>();
       
        for ( ModuleDefinition def : modules.values() ) {
            if ( def.getName().equals(root) ) {
                rootDef = def;
            }
           
            if ( def.getParentName() != null ) {
                ModuleDefinition parentDef = modules.get(def.getParentName());
               
                if ( parentDef != null )
                    parentDef.addChild(def);
            }
        }
       
        return traverse(rootDef, result);
    }
View Full Code Here

        loadContexts();
        startContexts();
    }
   
    protected boolean loadRootContext() {
        ModuleDefinition def = modules.get(root);
       
        if ( def == null )
            return false;
       
        ApplicationContext defaultsContext = getDefaultsContext();
View Full Code Here

            }
        });
    }
   
    protected void withModule(WithModule with) {
        ModuleDefinition rootDef = modules.get(root);
        withModule(rootDef, new Stack<ModuleDefinition>(), with);
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.spring.module.model.ModuleDefinition

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.