public class DefaultProcessController extends Object implements ProcessController
ProcessController which assumes a launch script which
takes operations as the first argument such as for the
Init Script Actions spec| Constructor and Description |
|---|
DefaultProcessController(String id,
ProcessConfig config,
File rootDir,
File baseDir) |
| Modifier and Type | Method and Description |
|---|---|
int |
configure() |
File |
getBaseDir() |
ProcessConfig |
getConfig() |
Executor |
getExecutor() |
protected String |
getLaunchScript() |
Long |
getPid() |
int |
install() |
int |
kill() |
int |
restart() |
protected int |
runCommandLine(String command)
Converts a space separated command line into a Command and executes it
|
protected int |
runConfigCommandValueOrLaunchScriptWith(String command,
String launchArgument) |
int |
start() |
int |
status() |
int |
stop() |
String |
toString() |
int |
uninstall() |
public DefaultProcessController(String id, ProcessConfig config, File rootDir, File baseDir)
id - identifier of the controlled process. Usually PID.public int install()
throws InterruptedException,
IOException,
CommandFailedException
install in interface ProcessControllerInterruptedExceptionIOExceptionCommandFailedExceptionpublic int uninstall()
uninstall in interface ProcessControllerpublic int start()
throws Exception
start in interface ProcessControllerExceptionpublic int stop()
throws Exception
stop in interface ProcessControllerExceptionpublic int kill()
throws Exception
kill in interface ProcessControllerExceptionpublic int restart()
throws Exception
restart in interface ProcessControllerExceptionpublic int status()
throws Exception
status in interface ProcessControllerExceptionpublic int configure()
throws Exception
configure in interface ProcessControllerExceptionpublic File getBaseDir()
public Executor getExecutor()
public ProcessConfig getConfig()
getConfig in interface ProcessControllerpublic Long getPid() throws IOException
getPid in interface ProcessControllerIOExceptionprotected String getLaunchScript()
protected int runConfigCommandValueOrLaunchScriptWith(String command, String launchArgument) throws InterruptedException, IOException, CommandFailedException
protected int runCommandLine(String command) throws IOException, InterruptedException, CommandFailedException
Copyright © 2014 Red Hat. All Rights Reserved.