Package org.impalaframework.module.operation

Examples of org.impalaframework.module.operation.ModuleOperationResult


        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");
                } else {
                    Throwable error = transitionResultSet.getFirstError();
                    return "One or more module operations failed: " + (error != null ? error.getMessage() : "error is null");
                }
            } else {
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

        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");
                } else {
                    Throwable error = transitionResultSet.getFirstError();
                    return "One or more module operations failed: " + (error != null ? error.getMessage() : "error is null");
                }
            } else {
View Full Code Here

  public String reloadModule(String moduleName) {

    ModuleOperation operation = moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation);
   
    try {
      ModuleOperationResult execute = operation.execute(new ModuleOperationInput(null, null, moduleName));
      if (execute.isSuccess()) {
        return "Successfully reloaded " + execute.getOutputParameters().get("moduleName");
      } else {
        return "Could not find module " + moduleName;
      }
    }
    catch (Throwable e) {
View Full Code Here

    public String reloadModule(String moduleName) {

        ModuleOperation operation = moduleOperationRegistry.getOperation(ModuleOperationConstants.ReloadModuleNamedLikeOperation);
       
        try {
            ModuleOperationResult execute = operation.execute(new ModuleOperationInput(null, null, moduleName));
            if (execute.isSuccess()) {
                return "Successfully reloaded " + execute.getOutputParameters().get("moduleName");
            } else {
                return "Could not find module " + moduleName;
            }
        }
        catch (Throwable e) {
View Full Code Here

     */
    public boolean reloadModule(String moduleName) {
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.ReloadNamedModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
        ModuleOperationResult result = execute(operation, moduleOperationInput);
        return result.isSuccess();
    }
View Full Code Here

     */
    public boolean reloadModule(String moduleName) {
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.ReloadNamedModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
        ModuleOperationResult result = execute(operation, moduleOperationInput);
        return result.isSuccess();
    }
View Full Code Here

        return application;
    }
   
    public boolean close() {
        ModuleOperation operation = moduleManagementFacade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.CloseRootModuleOperation);
        ModuleOperationResult execute = operation.execute(application, null);
        return execute.isErrorFree();
    }
View Full Code Here

TOP

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

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.