Package org.impalaframework.module

Examples of org.impalaframework.module.ModificationExtractor


public class ModificationExtractorRegistry {

  private Map<ModificationExtractorType, ModificationExtractor> modificationExtractors = new HashMap<ModificationExtractorType, ModificationExtractor>();

  public ModificationExtractor getModificationExtractor(ModificationExtractorType type) {
    ModificationExtractor calculator = modificationExtractors.get(type);

    if (calculator == null) {
      throw new NoServiceException("No " + ModificationExtractor.class.getSimpleName()
          + " available for modification type " + type);
    }
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

  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

    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());
   
    ModuleStateHolder moduleStateHolder = getModuleStateHolder();
    ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(ModificationExtractorType.STICKY);
   
    addModule(moduleStateHolder, calculator, moduleToAdd);
    return new ModuleOperationResult(true);
  }
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 = getModuleStateHolder();
    ModificationExtractor calculator = getModificationExtractorRegistry().getModificationExtractor(ModificationExtractorType.STRICT);
    boolean result = removeModule(moduleStateHolder, calculator, moduleToRemove);
    return result ? ModuleOperationResult.TRUE : ModuleOperationResult.FALSE;
  }
View Full Code Here

TOP

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