Examples of ModuleDefinition


Examples of org.impalaframework.module.ModuleDefinition

            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

Examples of org.impalaframework.module.ModuleDefinition

     */
    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

Examples of org.impalaframework.module.ModuleDefinition

            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

Examples of org.impalaframework.module.ModuleDefinition

                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

Examples of org.impalaframework.module.ModuleDefinition

     * 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

Examples of org.impalaframework.module.ModuleDefinition

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

Examples of org.impalaframework.module.ModuleDefinition

        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

Examples of org.impalaframework.module.ModuleDefinition

        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

Examples of org.impalaframework.module.ModuleDefinition

       
        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

Examples of org.impalaframework.module.ModuleDefinition

     */
    private void populateVertexDependencies(Vertex vertex) {
       
        Assert.notNull(vertex, "vertex cannot be null");
       
        final ModuleDefinition moduleDefinition = vertex.getModuleDefinition();
       
        final List<String> dependentModuleNames = moduleDefinition.getDependentModuleNames();
        for (String dependent : dependentModuleNames) {
           
            final Vertex dependentVertex = vertexMap.get(dependent);
           
            if (dependentVertex == null) {
                throw new InvalidStateException("Unable to dependency named named '" + dependent
                        + "' for module definition '" + moduleDefinition.getName() + "'");
               
            } else {
                //register the vertex dependency
                populateVertexDependency(vertex, dependentVertex);
            }
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.