Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModificationExtractor


    public ModuleOperationResult doExecute(Application application, ModuleOperationInput moduleOperationInput) {
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        ModificationExtractorRegistry modificationExtractorRegistry = getModificationExtractorRegistry();
        ModificationExtractor calculator = modificationExtractorRegistry
                .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


        RootModuleDefinition oldModuleDefinition = getExistingModuleDefinitionSource(application);
       
        ModificationExtractorType modificationExtractorType = getModificationExtractorType();
       
        // figure out the modules to reload
        ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(modificationExtractorType);
       
        TransitionSet transitions = calculator.getTransitions(application, oldModuleDefinition, newModuleDefinition);
        TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
        return new ModuleOperationResult(transitionResultSet);
    }
View Full Code Here

       
        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        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

        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        RootModuleDefinition oldRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
        RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();

        ModificationExtractorRegistry modificationExtractor = getModificationExtractorRegistry();
        ModificationExtractor calculator = modificationExtractor
                .getModificationExtractor(ModificationExtractorType.STRICT);

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

        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;
        }
View Full Code Here

        RootModuleDefinition oldModuleDefinition = getExistingModuleDefinitionSource(application);
       
        ModificationExtractorType modificationExtractorType = getModificationExtractorType();
       
        // figure out the modules to reload
        ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(modificationExtractorType);
       
        if (oldModuleDefinition == null && newModuleDefinition == null) {
            return ModuleOperationResult.EMPTY;
        }

        super.isReloadPermitted(oldModuleDefinition);
       
        TransitionSet transitions = calculator.getTransitions(application, oldModuleDefinition, newModuleDefinition);
        TransitionResultSet transitionResultSet = getTransitionManager().processTransitions(moduleStateHolder, application, transitions);
        return new ModuleOperationResult(transitionResultSet);
    }
View Full Code Here

       
        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        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

    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    RootModuleDefinition oldRootDefinition = moduleStateHolder.cloneRootModuleDefinition();
    RootModuleDefinition newRootDefinition = moduleStateHolder.cloneRootModuleDefinition();

    ModificationExtractorRegistry modificationExtractor = getModificationExtractorRegistry();
    ModificationExtractor calculator = modificationExtractor
        .getModificationExtractor(ModificationExtractorType.STRICT);

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

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

      TransitionSet transitions = calculator.getTransitions(oldRootDefinition, newRootDefinition);
      moduleStateHolder.processTransitions(transitions);

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

        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        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

  public ModuleOperationResult doExecute(ModuleOperationInput moduleOperationInput) {
   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    ModificationExtractorRegistry modificationExtractorRegistry = getModificationExtractorRegistry();
    ModificationExtractor calculator = modificationExtractorRegistry
        .getModificationExtractor(ModificationExtractorType.STRICT);
    RootModuleDefinition rootModuleDefinition = moduleStateHolder.getRootModuleDefinition();
   
    if (rootModuleDefinition != null) {
      logger.info("Shutting down application context");
      TransitionSet transitions = calculator.getTransitions(rootModuleDefinition, null);
      moduleStateHolder.processTransitions(transitions);
      return ModuleOperationResult.TRUE;
    }
    else {
      return ModuleOperationResult.FALSE;
View Full Code Here

    RootModuleDefinition oldModuleDefinition = getExistingModuleDefinitionSource();
   
    ModificationExtractorType modificationExtractorType = getModificationExtractorType();
   
    // figure out the modules to reload
    ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(modificationExtractorType);
   
    TransitionSet transitions = calculator.getTransitions(oldModuleDefinition, newModuleDefinition);
    moduleStateHolder.processTransitions(transitions);
    return ModuleOperationResult.TRUE;
  }
View Full Code Here

TOP

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

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.