Examples of ModuleStateHolder


Examples of org.impalaframework.module.spi.ModuleStateHolder

   
    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

Examples of org.impalaframework.module.spi.ModuleStateHolder

   
    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

Examples of org.impalaframework.module.spi.ModuleStateHolder

        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        String moduleToReload = moduleOperationInput.getModuleName();
        Assert.notNull(moduleToReload, "moduleName is required as it specifies the name of the module to reload in "
                + this.getClass().getName());

        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

Examples of org.impalaframework.module.spi.ModuleStateHolder

        super();
    }

    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

Examples of org.impalaframework.module.spi.ModuleStateHolder

        String moduleToReload = moduleOperationInput.getModuleName();
        Assert.notNull(moduleToReload,
                "moduleName is required as it specifies the name used to match the module to reload in "
                        + this.getClass().getName());
       
        ModuleStateHolder moduleStateHolder = getModuleStateHolder();
        RootModuleDefinition newDefinition = moduleStateHolder.cloneRootModuleDefinition();

        ModuleDefinition found = newDefinition.findChildDefinition(moduleToReload, false);

        if (found != null) {
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateHolder

    final ServletContext servletContext = servlet.getServletContext();
    ModuleManagementFacade facade = ImpalaServletUtils.getModuleManagementFacade(servletContext);

    final String servletName = servlet.getServletName();
    Application application = facade.getApplicationManager().getCurrentApplication();
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      ModuleStateChangeListener listener = newModuleStateChangeListener(servletName);
View Full Code Here

Examples of org.impalaframework.module.spi.ModuleStateHolder

    }

    public ModuleOperationResult doExecute(ModuleOperationInput moduleOperationInput) {

        Assert.notNull(moduleOperationInput, "moduleOperationInput cannot be null");
        ModuleStateHolder moduleStateHolder = getModuleStateHolder();
       
        //note that the module definition source is externally supplied
        ModuleDefinitionSource newModuleDefinitionSource = moduleOperationInput.getModuleDefinitionSource();
        Assert.notNull(newModuleDefinitionSource, "moduleDefinitionSource is required as it specifies the new module definition to apply in " + this.getClass().getName());
       
        RootModuleDefinition newModuleDefinition = newModuleDefinitionSource.getModuleDefinition();
        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

Examples of org.impalaframework.module.spi.ModuleStateHolder

       
        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

Examples of org.impalaframework.module.spi.ModuleStateHolder

       
        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

Examples of org.impalaframework.module.spi.ModuleStateHolder

        boolean success = true;
       
        final String moduleName = currentDefinition.getName();
        logger.info("Loading definition " + moduleName);
       
        final ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
        final ServiceRegistry serviceRegistry = application.getServiceRegistry();
       
        if (moduleStateHolder.getModule(moduleName) == null) {

            ModuleRuntime moduleRuntime = getModuleRuntime(currentDefinition);
           
            try {
                RuntimeModule runtimeModule = moduleRuntime.loadRuntimeModule(application, currentDefinition);
                moduleStateHolder.putModule(moduleName, runtimeModule);
            }
            catch (Throwable e) {
               
                try {
                    serviceRegistry.evictModuleServices(moduleName);
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.