Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.TransitionResultSet


        ModuleDefinition moduleToAdd = moduleOperationInput.getModuleDefinition();
        Assert.notNull(moduleToAdd, "moduleName is required as it specifies the name of the module to add in " + this.getClass().getName());
       
        ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(ModificationExtractorType.STICKY);
       
        TransitionResultSet transitionResultSet = addModule(application, calculator, moduleToAdd);
        return new ModuleOperationResult(transitionResultSet);
    }
View Full Code Here


        String moduleToRemove = moduleOperationInput.getModuleName();
        Assert.notNull(moduleToRemove, "moduleName is required as it specifies the name of the module to remove in " + this.getClass().getName());
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(ModificationExtractorType.STRICT);
        TransitionResultSet transitionResultSet = removeModule(moduleStateHolder, application, calculator, moduleToRemove);
       
        boolean hasResults = transitionResultSet.hasResults();
        return hasResults ? new ModuleOperationResult(transitionResultSet) : ModuleOperationResult.EMPTY;
    }
View Full Code Here

            ModificationExtractor calculator, String moduleToRemove) {
       
        RootModuleDefinition oldRootDefinition = moduleStateHolder.getRootModuleDefinition();
       
        if (oldRootDefinition == null) {
            return new TransitionResultSet();
        }
       
        RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
        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. "
                            + "This is unexpected state and may indicate a bug");
                }
            }
        }
        return new TransitionResultSet();
    }
View Full Code Here

TOP

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

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.