Package org.impalaframework.module.operation

Examples of org.impalaframework.module.operation.ModuleOperationInput


        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


        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

              + ModuleDefinitionSource.class.getName()
              + " found. Your context loader needs to be configured to create an instance of this class and attach it to the ServletContext using the attribue WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE");

    }

    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

    // 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();
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()) {
                    return "Successfully reloaded " + execute.getOutputParameters().get("moduleName");
View Full Code Here

    public void testReload() {

        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation)).andReturn(moduleOperation);
        HashMap<String, Object> resultMap = new HashMap<String, Object>();
        resultMap.put("moduleName", "moduleName");
        expect(moduleOperation.execute(application, new ModuleOperationInput(null, null, "someModule"))).andReturn(new ModuleOperationResult(newSuccessTransitionResultSet(), resultMap));
        replayMocks();

        assertEquals("Successfully reloaded moduleName", operations.reloadModule("someModule"));

        verifyMocks();
View Full Code Here

    public void testReloadFailed() {

        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation)).andReturn(moduleOperation);
        HashMap<String, Object> resultMap = new HashMap<String, Object>();
        resultMap.put("moduleName", "moduleName");
        expect(moduleOperation.execute(application, new ModuleOperationInput(null, null, "someModule"))).andReturn(new ModuleOperationResult(newFailedTransitionResultSet(), resultMap));
        replayMocks();

        assertEquals("One or more module operations failed: stuff went wrong1", operations.reloadModule("someModule"));

        verifyMocks();
View Full Code Here

    }
   
    public void testModuleNotFound() {
       
        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation)).andReturn(moduleOperation);
        expect(moduleOperation.execute(application, new ModuleOperationInput(null, null, "someModule"))).andReturn(new ModuleOperationResult(new TransitionResultSet()));

        replayMocks();

        assertEquals("Could not find module someModule", operations.reloadModule("someModule"));
View Full Code Here

    }
   
    public void testThrowException() {

        expect(moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation)).andReturn(moduleOperation);
        expect(moduleOperation.execute(application, new ModuleOperationInput(null, null, "someModule"))).andThrow(new IllegalStateException());

        replayMocks();

        assertTrue(operations.reloadModule("someModule").contains("IllegalStateException"));
View Full Code Here

TOP

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

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.