Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.ModuleStateHolder


        Assert.notNull(classLoaderRegistryFactory, "classLoaderRegistryFactory cannot be null");
        Assert.notNull(moduleStateHolderFactory, "moduleStateHolderFactory cannot be null");
        Assert.notNull(serviceRegistryFactory, "serviceRegistryFactory cannot be null");
       
        ClassLoaderRegistry classLoaderRegistry = classLoaderRegistryFactory.newClassLoaderRegistry();
        ModuleStateHolder moduleStateHolder = moduleStateHolderFactory.newModuleStateHolder();
        ServiceRegistry serviceRegistry = serviceRegistryFactory.newServiceRegistry();
        Application application = new ImpalaApplication(classLoaderRegistry, moduleStateHolder, serviceRegistry, id);
   
        return application;
    }
View Full Code Here


       
        if (beanVisibilityType.equals(PARENT_ONLY)) {
            return parentApplicationContext;
        }
       
        ModuleStateHolder moduleStateHolder = application.getModuleStateHolder();
       
        if (beanVisibilityType.equals(PARENT_FIRST)) {
            GraphModuleStateHolder graphModuleStateHolder = ObjectUtils.cast(moduleStateHolder, GraphModuleStateHolder.class);
            return new ParentFirstBeanGraphInheritanceStrategy().getParentApplicationContext(graphModuleStateHolder, parentApplicationContext, definition);    
        }
View Full Code Here

        RootModuleDefinition moduleDefinition = new Provider().getModuleDefinition();

        TransitionSet transitions = facade.getModificationExtractorRegistry()
                .getModificationExtractor(ModificationExtractorType.STICKY).getTransitions(null, null, moduleDefinition);

        ModuleStateHolder moduleStateHolder = facade.getApplicationManager().getCurrentApplication().getModuleStateHolder();
        TransitionManager transitionManager = facade.getTransitionManager();
       
        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
View Full Code Here

    // the superclass closes the modules
    final ServletContext servletContext = servlet.getServletContext();
    ModuleManagementFacade facade = ImpalaServletUtils.getModuleManagementFacade(servletContext);

    final String servletName = servlet.getServletName();
    ModuleStateHolder moduleStateHolder = facade.getModuleStateHolder();
   
    if (!initialized) {
     
      ModuleStateChangeNotifier moduleStateChangeNotifier = facade.getModuleStateChangeNotifier();
      moduleStateChangeNotifier.addListener(new ModuleStateChangeListener() {
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

        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

        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

        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

    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

TOP

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

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.