Package org.impalaframework.module.operation

Examples of org.impalaframework.module.operation.ModuleOperation


        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


        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

    }

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

      for (String moduleName : modified) {

        logger.info("Processing modified module " + moduleName);

        ModuleOperation operation = factory.getModuleOperationRegistry().getOperation(ModuleOperationConstants.ReloadNamedModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
        operation.execute(moduleOperationInput);
      }
    }
  }
View Full Code Here

        ServletContext servletContext = createMock(ServletContext.class);
        final WebModuleChangeListener listener = new WebModuleChangeListener();
        listener.setServletContext(servletContext);
        ModuleManagementFacade facade = createMock(ModuleManagementFacade.class);
        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);
       
        replay(servletContext);
        replay(facade);
        replay(moduleOperationRegistry);
        replay(moduleOperation);
View Full Code Here

    // add items to servlet context
    servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
    servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, facade);
   
    ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);   
    operation.execute(input);

    ConfigurableApplicationContext context = facade.getModuleStateHolder().getRootModuleContext();

    if (context == null) {
      throw new InvalidStateException("Root application context is null");
View Full Code Here

    if (facade != null) {

      servletContext.log("Closing modules and root application context hierarchy");

      ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.CloseRootModuleOperation);
      boolean success = operation.execute(null).isSuccess();

      if (!success) {
        // this is the fallback in case the rootDefinition is null
        super.closeWebApplicationContext(servletContext);
      }
View Full Code Here

    public String reloadModule(String moduleName) {

        Assert.notNull(applicationManager, "applicationManager cannot be null");
        Assert.notNull(moduleOperationRegistry, "moduleOperationRegistry cannot be null");
       
        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()) {
                    return "Successfully reloaded " + execute.getOutputParameters().get("moduleName");
View Full Code Here

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

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

TOP

Related Classes of org.impalaframework.module.operation.ModuleOperation

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.