Examples of executeProcess()


Examples of org.rhq.core.system.SystemInfo.executeProcess()

            startScriptExe.addArguments(Arrays.asList("-p", "cassandra.pid"));
        }

        startScriptExe.setWaitForCompletion(0);

        ProcessExecutionResults results = systemInfo.executeProcess(startScriptExe);
        if (log.isDebugEnabled()) {
            log.debug(startScript + " returned with exit code [" + results.getExitCode() + "]");
        }

        return results;
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

        processExecution.setWorkingDirectory(workingDir);
        processExecution.setWaitForCompletion(waitTime);
        processExecution.setCaptureOutput(capture);
        processExecution.setKillOnTimeout(killOnTimeout);

        ProcessExecutionResults results = systemInfo.executeProcess(processExecution);

        Integer exitCode = results.getExitCode();
        Throwable error = results.getError();
        String output = results.getCapturedOutput();
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

                //processExecution.setEnvironmentVariables(envvars);
                processExecution.setWorkingDirectory(new File(this.agent.getAgentHomeDirectory()).getParent());
                processExecution.setCaptureOutput(false);
                processExecution.setWaitForCompletion(0);
                showMessage(AgentI18NResourceKeys.UPDATE_THREAD_EXECUTING_UPDATE_PROCESS, processExecution);
                ProcessExecutionResults results = sysInfo.executeProcess(processExecution);
                if (results.getError() != null) {
                    throw results.getError();
                }

                // update has started! if this agent is running in non-daemon mode, kill
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

        processExecution.setCaptureOutput(true);
        processExecution.setWaitForCompletion(1000L);
        processExecution.setKillOnTimeout(true);

        ProcessExecutionResults results = sysInfo.executeProcess(processExecution);

        return results;
    }

}
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

            failure.setErrorMessage("Start script does not exists");
            return failure;
        }
        ProcessExecution scriptExe = getProcessExecution(binDir);
        SystemInfo systemInfo = getResourceContext().getSystemInformation();
        ProcessExecutionResults results = systemInfo.executeProcess(scriptExe);
        if (results.getError() == null) {
            return new OperationResult("Successfully started Cassandra daemon");
        } else {
            OperationResult failure = new OperationResult("Failed to start Cassandra daemon");
            failure.setErrorMessage(ThrowableUtil.getAllMessages(results.getError()));
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

            if (log.isDebugEnabled()) {
                log.debug(processExecution);
            }

            ProcessExecutionResults processExecutionResults = systemInfo.executeProcess(processExecution);
            if (processExecutionResults.getError() != null) {
                throw new Exception(processExecutionResults.getError());
            }

            Integer exitCode = processExecutionResults.getExitCode();
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

            if (log.isDebugEnabled()) {
                log.debug(processExecution);
            }

            ProcessExecutionResults processExecutionResults = systemInfo.executeProcess(processExecution);
            if (processExecutionResults.getError() != null) {
                throw new Exception(processExecutionResults.getError());
            }

            Integer exitCode = processExecutionResults.getExitCode();
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

        long start = System.currentTimeMillis();
        if (log.isDebugEnabled()) {
            log.debug("About to execute the following process: [" + processExecution + "]");
        }
        SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation();
        ProcessExecutionResults results = systemInfo.executeProcess(processExecution);
        logExecutionResults(results);

        if (results.getError() == null) {
            avail = waitForServerToStart(start);
        } else {
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

        if (log.isDebugEnabled()) {
            log.debug("About to execute the following process: [" + processExecution + "]");
        }
        SystemInfo systemInfo = serverComponent.getResourceContext().getSystemInformation();
        ProcessExecutionResults results = systemInfo.executeProcess(processExecution);
        logExecutionResults(results);

        if (results.getError() != null || (results.getExitCode() != null && results.getExitCode() != 0)) {
            throw new ExecutionFailedException(
                "Error executing shutdown script while stopping AS instance. Shutdown script returned exit code ["
View Full Code Here

Examples of org.rhq.core.system.SystemInfo.executeProcess()

                try {
                    Thread.sleep(10000L); // this should be enough to return our operation results back
                    ProcessExecution exe = new ProcessExecution(script.getAbsolutePath());
                    exe.setArguments(new String[] { arg });
                    exe.setWorkingDirectory(script.getParent());
                    ProcessExecutionResults results = sysInfo.executeProcess(exe);
                    if (results != null && results.getError() != null) {
                        throw results.getError();
                    }
                } catch (Throwable t) {
                    log.error("Failed to invoke [" + script + ' ' + arg + "] in a thread", t);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.