Package org.impalaframework.module

Examples of org.impalaframework.module.ModuleDefinition


        }
    }
   
    private RootModuleDefinition readRootModuleDefinition(Properties rootModuleProperties,
            TypeReader typeReader) {
        ModuleDefinition moduleDefinition = typeReader.readModuleDefinition(null, rootModuleName, rootModuleProperties);
        if (!(moduleDefinition instanceof RootModuleDefinition)) {
            throw new IllegalStateException("Type reader " + typeReader + " produced " + ModuleDefinition.class.getSimpleName() + " which is not an instance of " + RootModuleDefinition.class.getName());
        }
        RootModuleDefinition rootDefinition = (RootModuleDefinition) moduleDefinition;
        return rootDefinition;
View Full Code Here


            Collection<ModuleDefinition> oldChildren,
            Collection<ModuleDefinition> newChildren,
            List<ModuleStateChange> transitions) {
   
        for (ModuleDefinition oldChild : oldChildren) {
            ModuleDefinition newChild = ModuleDefinitionUtils.getModuleFromCollection(newChildren, oldChild.getName());

            if (newChild == null) {
                newParent.addChildModuleDefinition(oldChild);
                oldChild.setParentDefinition(newParent);
            }
View Full Code Here

     */
    public void notify(ModuleStateHolder moduleStateHolder, TransitionResult transitionResult) {
       
        ModuleStateChange moduleStateChange = transitionResult.getModuleStateChange();
       
        ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();

        for (ModuleStateChangeListener moduleStateChangeListener : listeners) {
            String moduleName = moduleStateChangeListener.getModuleName();

            boolean notify = true;

            if (moduleName != null) {
                if (!moduleName.equals(moduleDefinition.getName())) {
                    notify = false;
                }
            }

            if (notify) {
View Full Code Here

            Collection<ModuleDefinition> oldChildren,
            Collection<ModuleDefinition> newChildren,
            List<ModuleStateChange> transitions) {
   
        for (ModuleDefinition oldChild : oldChildren) {
            ModuleDefinition newChild = ModuleDefinitionUtils.getModuleFromCollection(newChildren, oldChild.getName());

            if (newChild == null) {
                newParent.addChildModuleDefinition(oldChild);
                oldChild.setParentDefinition(newParent);
            }
View Full Code Here

                if (logger.isDebugEnabled()) {
                    logger.debug("Processing module state change: " + change);
                }
               
                String transition = change.getTransition();
                ModuleDefinition currentModuleDefinition = change.getModuleDefinition();

                TransitionProcessor transitionProcessor = transitionProcessorRegistry.getTransitionProcessor(transition);
               
                TransitionResult result;
     
View Full Code Here

     * implementation. If no parent definition is available, the built {@link ModuleDefinition} instance
     * is added as a sibling to the {@link RootModuleDefinition}.
     */
    public RootModuleDefinition getModuleDefinition() {
       
        ModuleDefinition currentParentDefinition = parentDefinition;
        for (String moduleName : modulesToLoad) {
            ModuleDefinition definition = buildModuleDefinition(currentParentDefinition, moduleName);
           
            if (currentParentDefinition == null) {
                Assert.isTrue(!definition.getName().equals(rootModuleDefinition.getName()), "Module definition with no parent cannot be the root module definition");
                rootModuleDefinition.addSibling(definition);
            }
           
            currentParentDefinition = definition;
        }
View Full Code Here

                }
            }
           
            for (ModuleDefinition newSibling : newSiblings) {
                if (originalDefinition.hasSibling(newSibling.getName())) {
                    final ModuleDefinition siblingModule = originalDefinition.getSiblingModule(newSibling.getName());
                    compare(siblingModule, newSibling, transitions);
                }
            }
        }
    }
View Full Code Here

        Collection<ModuleDefinition> loadable = new LinkedHashSet<ModuleDefinition>();
       
        //collect unloaded first
        for (ModuleStateChange moduleStateChange : transitions) {
            if (moduleStateChange.getTransition().equals(Transition.UNLOADED_TO_LOADED)) {
                final ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();
               
                //are we likely to get duplicates
                loadable.add(moduleDefinition);
            }
        }
View Full Code Here

        Collection<ModuleDefinition> unloadable = new LinkedHashSet<ModuleDefinition>();
       
        //collect unloaded first
        for (ModuleStateChange moduleStateChange : transitions) {
            if (moduleStateChange.getTransition().equals(Transition.LOADED_TO_UNLOADED)) {
                final ModuleDefinition moduleDefinition = moduleStateChange.getModuleDefinition();
               
                //are we likely to get duplicates
                unloadable.add(moduleDefinition);
            }
        }
View Full Code Here

       
        logger.info("With parent '" + parent + "', adding module: " + moduleDefinition);
       
        final Vertex parentVertex = getRequiredVertex(parent);
       
        ModuleDefinition parentDefinition = parentVertex.getModuleDefinition();
        parentDefinition.addChildModuleDefinition(moduleDefinition);
        moduleDefinition.setParentDefinition(parentDefinition);
       
        //now recursively add definitions
        List<Vertex> addedVertices = new ArrayList<Vertex>();
        populateDefinition(addedVertices, moduleDefinition);
View Full Code Here

TOP

Related Classes of org.impalaframework.module.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.