Package org.impalaframework.module.spi

Examples of org.impalaframework.module.spi.Application


       
        Assert.notNull(servletContext);

        ModuleManagementFacade facade = getFacade();
        ModuleDefinitionSource source = getSource();
        Application application = getApplication(facade);

        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(source, null, null);
       
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.ReloadRootModuleOperation);
        operation.execute(application, moduleOperationInput);
View Full Code Here


       
        Assert.notNull(servletContext);

        ModuleManagementFacade facade = getFacade();
        ModuleDefinitionSource source = getSource();
        Application application = getApplication(facade);

        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(source, null, null);
       
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.CloseRootModuleOperation);
        operation.execute(application, moduleOperationInput);
View Full Code Here

        operation.execute(application, moduleOperationInput);
    }

    private Application getApplication(ModuleManagementFacade facade) {
        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
        return application;
    }
View Full Code Here

        ModuleOperationRegistry moduleOperationRegistry = createMock(ModuleOperationRegistry.class);
        ModuleOperation moduleOperation = createMock(ModuleOperation.class);

        expect(servletContext.getAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE)).andReturn(facade);
        ApplicationManager applicationManager = TestApplicationManager.newApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        expect(facade.getApplicationManager()).andReturn(applicationManager);
        expect(facade.getModuleOperationRegistry()).andReturn(moduleOperationRegistry);
        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadNamedModuleOperation)).andReturn(moduleOperation);
        expect(moduleOperation.execute(eq(application), isA(ModuleOperationInput.class))).andReturn(ModuleOperationResult.EMPTY);
View Full Code Here

        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

       
        ModuleOperation operation = moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation);
       
        try {
           
            Application application = applicationManager.getCurrentApplication();
            ModuleOperationResult execute = operation.execute(application, new ModuleOperationInput(null, null, moduleName));
           
            TransitionResultSet transitionResultSet = execute.getTransitionResultSet();
            if (transitionResultSet.hasResults()) {
                if (transitionResultSet.isSuccess()) {
View Full Code Here

        ModuleStateHolder moduleStateHolder = facade.getApplicationManager().getCurrentApplication().getModuleStateHolder();
        TransitionManager transitionManager = facade.getTransitionManager();
       
        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        transitionManager.processTransitions(moduleStateHolder, application, transitions);

        ModuleManagementOperations operations = (ModuleManagementOperations) facade.getBean("moduleManagementOperations");
View Full Code Here

        // add items to servlet context
        servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
        servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, facade);

        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);      
        operation.execute(application, input);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(application.getModuleStateHolder());

        if (context == null) {
            logger.warn("Root module context is null: no modules loaded");
        }
        else if (!(context instanceof WebApplicationContext)) {
View Full Code Here

        // add items to servlet context
        servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
        servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, facade);

        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();
       
        ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);      
        operation.execute(application, input);

        ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(application.getModuleStateHolder());

        if (context == null) {
            logger.warn("Root module context is null: no modules loaded");
        }
        else if (!(context instanceof WebApplicationContext)) {
View Full Code Here

            }
           
            ModuleManagementFacade moduleManagementFacade = WebServletUtils.getModuleManagementFacade(servletContext);
            if (moduleManagementFacade != null) {
               
                Application application = moduleManagementFacade.getApplicationManager().getApplication(applicationId);
                RuntimeModule currentModuleContext = application.getModuleStateHolder().getModule(moduleName);
               
                if (currentModuleContext != null) {
                    return new StateProtectingHttpSession(session, webAttributeQualifier, applicationId, moduleName, currentModuleContext.getClassLoader());
                } else {
                    logger.warn("No module application context associated with module: " + moduleName + ". Using unwrapped session");
View Full Code Here

TOP

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

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.