Package org.impalaframework.module.operation

Examples of org.impalaframework.module.operation.ModuleOperation


    /**
     * Adds the module as determined by the supplied module definition
     */
    public void addModule(final ModuleDefinition moduleDefinition) {
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.AddModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, moduleDefinition, null);
        execute(operation, moduleOperationInput);
    }
View Full Code Here


  protected ContextStarter getContextStarter() {
    return new ClassPathApplicationContextStarter();
  }

  public void init(ModuleDefinitionSource source) {
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.IncrementalUpdateRootModuleOperation);
    operation.execute(new ModuleOperationInput(source, null, null));
  }
View Full Code Here

  /*
   * **************************** modifying operations * **************************
   */

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

    return like;
  }

  public void reloadRootModule() {
    RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.CloseRootModuleOperation);
    operation.execute(null);
    ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
        rootModuleDefinition);

    ModuleOperationInput input = new ModuleOperationInput(newModuleDefinitionSource, null, null);
    operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.UpdateRootModuleOperation);
    operation.execute(input);
  }
View Full Code Here

        ModuleOperationConstants.UpdateRootModuleOperation);
    operation.execute(input);
  }

  public void unloadRootModule() {
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.CloseRootModuleOperation);
    operation.execute(null);
  }
View Full Code Here

        ModuleOperationConstants.CloseRootModuleOperation);
    operation.execute(null);
  }

  public boolean remove(String moduleName) {
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.RemoveModuleOperation);
    ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
    return operation.execute(moduleOperationInput).isSuccess();
  }
View Full Code Here

    ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
    return operation.execute(moduleOperationInput).isSuccess();
  }

  public void addModule(final ModuleDefinition moduleDefinition) {
    ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
        ModuleOperationConstants.AddModuleOperation);
    ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, moduleDefinition, null);
    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

    // load the parent context, which is web-independent
    ModuleDefinitionSource moduleDefinitionSource = getModuleDefinitionSource(servletContext, factory);
   
    ModuleOperationInput input = new ModuleOperationInput(moduleDefinitionSource, null, null);
    ModuleOperation operation = factory.getModuleOperationRegistry().getOperation(ModuleOperationConstants.UpdateRootModuleOperation);   
    operation.execute(input);

    // add items to servlet context
    servletContext.setAttribute(WebConstants.MODULE_DEFINITION_SOURCE_ATTRIBUTE, moduleDefinitionSource);
    servletContext.setAttribute(WebConstants.IMPALA_FACTORY_ATTRIBUTE, factory);
View Full Code Here

    if (factory != null) {

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

      ModuleOperation operation = factory.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

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.