Package org.impalaframework.module.operation

Examples of org.impalaframework.module.operation.ModuleOperation


    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


    @ManagedOperation(description = "Operation to reload a module")
    @ManagedOperationParameters( { @ManagedOperationParameter(name = "Module name", description = "Name of module to reload") })
    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;
            }
View Full Code Here

        ApplicationManager applicationManager = facade.getApplicationManager();
        Application application = applicationManager.getCurrentApplication();

        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(source, null, null);
       
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(ModuleOperationConstants.ReloadRootModuleOperation);
        operation.execute(application, 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

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

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

    /**
     * Attempts to reload named module. Returns true if module is found and is successfully reloaded
     */
    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

    /**
     * Attempts to reload the root module
     */
    public void reloadRootModule() {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.CloseRootModuleOperation);
        execute(operation, null);
        ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
                rootModuleDefinition);

View Full Code Here

    /**
     * Attempts to repair any modules which are in an error state
     */
    public void repairModules() {
        RootModuleDefinition rootModuleDefinition = getModuleStateHolder().getRootModuleDefinition();
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.RepairModuleOperation);
        ConstructedModuleDefinitionSource newModuleDefinitionSource = new ConstructedModuleDefinitionSource(
                rootModuleDefinition);

        ModuleOperationInput input = new ModuleOperationInput(newModuleDefinitionSource, null, null);
View Full Code Here

    /**
     * Unloads all modules, starting from the root module
     */
    public void unloadRootModule() {
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.CloseRootModuleOperation);
        execute(operation, null);
    }
View Full Code Here

    /**
     * Unloads and removes the named module
     */
    public boolean removeModule(String moduleName) {
        ModuleOperation operation = facade.getModuleOperationRegistry().getOperation(
                ModuleOperationConstants.RemoveModuleOperation);
        ModuleOperationInput moduleOperationInput = new ModuleOperationInput(null, null, moduleName);
        return execute(operation, moduleOperationInput).isSuccess();
    }
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.