Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.TransitionSet


    public void testModifiedParent() {
        RootModuleDefinition parentSpec1 = ModificationTestUtils.spec("app-context1.xml", "plugin1, plugin2");
        RootModuleDefinition parentSpec2 = ModificationTestUtils.spec("app-context2.xml", "plugin1, plugin2");

        TransitionSet transitions = calculator.getTransitions(application, parentSpec1, parentSpec2);
        assertEquals(parentSpec2, transitions.getNewRootModuleDefinition());

        Collection<? extends ModuleStateChange> moduleTransitions = transitions.getModuleTransitions();
        assertEquals(6, moduleTransitions.size());

        Iterator<? extends ModuleStateChange> iterator = moduleTransitions.iterator();
        ModuleStateChange change1 = iterator.next();
        ModuleStateChange change2 = iterator.next();
View Full Code Here


        ModuleDefinition childDefinition = newRootDefinition.findChildDefinition(moduleToReload, true);

        if (childDefinition != null) {
            childDefinition.setState(ModuleState.STALE);

            TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, newRootDefinition);
            TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);

            boolean result = !transitions.getModuleTransitions().isEmpty();
            return result ? new ModuleOperationResult(transitionResultSet) : ModuleOperationResult.EMPTY;
        }
       
        return ModuleOperationResult.EMPTY;
    }
View Full Code Here

                .getModificationExtractor(ModificationExtractorType.STRICT);
        RootModuleDefinition rootModuleDefinition = moduleStateHolder.getRootModuleDefinition();
       
        if (rootModuleDefinition != null) {
            logger.info("Shutting down application context");
            TransitionSet transitions = calculator.getTransitions(application, rootModuleDefinition, null);
            TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
            return new ModuleOperationResult(transitionResultSet);
        }
        else {
            return new ModuleOperationResult(new TransitionResultSet());
View Full Code Here

    populateTransitions(transitions, originalDefinition, newDefinition);
   
    if (newDefinition != null) {
      ModuleDefinitionUtils.freeze(newDefinition);
    }
    return new TransitionSet(transitions, newDefinition);
  }
View Full Code Here

       
        if (oldModuleDefinition == null && newModuleDefinition == null) {
            return ModuleOperationResult.EMPTY;
        }
       
        TransitionSet transitions = calculator.getTransitions(application, oldModuleDefinition, newModuleDefinition);
        TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
        return new ModuleOperationResult(transitionResultSet);
    }
View Full Code Here

        ModuleDefinition definitionToRemove = newRootDefinition.findChildDefinition(moduleToRemove, true);

        if (definitionToRemove != null) {
            if (definitionToRemove instanceof RootModuleDefinition) {
                //we're removing the rootModuleDefinition
                TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, null);
                TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
                return transitionResultSet;
            }
            else {
                ModuleDefinition parent = definitionToRemove.getParentDefinition();
                if (parent != null) {
                    parent.removeChildModuleDefinition(moduleToRemove);
                   
                    definitionToRemove.setParentDefinition(null);

                    TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, newRootDefinition);
                    TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
                    return transitionResultSet;
                }
                else {
                    throw new InvalidStateException("Module to remove does not have a parent module. "
View Full Code Here

        ModuleDefinition childDefinition = newRootDefinition.findChildDefinition(moduleToReload, true);

        if (childDefinition != null) {
            childDefinition.setState(ModuleState.STALE);

            TransitionSet transitions = calculator.getTransitions(application, oldRootDefinition, newRootDefinition);
            TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);

            boolean result = !transitions.getModuleTransitions().isEmpty();
            return result ? new ModuleOperationResult(transitionResultSet) : ModuleOperationResult.EMPTY;
        }
       
        return ModuleOperationResult.EMPTY;
    }
View Full Code Here

    public final TransitionSet getTransitions(
            Application application,
            RootModuleDefinition originalDefinition, RootModuleDefinition newDefinition) {
       
        GraphAwareModificationExtractor delegate = newDelegate();
        TransitionSet transitions = delegate.getTransitions(application, originalDefinition, newDefinition);
       
        GraphModuleStateHolder moduleStateHolder = ObjectUtils.cast(application.getModuleStateHolder(), GraphModuleStateHolder.class);
       
        //method marked as final means this will be called
        moduleStateHolder.setDependencyManager(delegate.getNewDependencyManager());    
View Full Code Here

                .getModificationExtractor(ModificationExtractorType.STRICT);
        RootModuleDefinition rootModuleDefinition = moduleStateHolder.getRootModuleDefinition();
       
        if (rootModuleDefinition != null) {
            logger.info("Shutting down application context");
            TransitionSet transitions = calculator.getTransitions(application, rootModuleDefinition, null);
            TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
            return new ModuleOperationResult(transitionResultSet);
        }
        else {
            return new ModuleOperationResult(new TransitionResultSet());
View Full Code Here

        populateTransitions(transitions, originalDefinition, newDefinition);
       
        if (newDefinition != null) {
            ModuleDefinitionUtils.freeze(newDefinition);
        }
        return new TransitionSet(transitions, newDefinition);
    }
View Full Code Here

TOP

Related Classes of org.impalaframework.module.spi.TransitionSet

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.