public abstract class AbstractProcess<T extends IExecutableProcessConfig,E extends Executable<T,P>,P extends IStopable> extends Object implements IStopable
| Modifier and Type | Field and Description |
|---|---|
static int |
TIMEOUT |
| Constructor and Description |
|---|
AbstractProcess(Distribution distribution,
T config,
IRuntimeConfig runtimeConfig,
E executable) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
cleanupInternal() |
protected abstract List<String> |
getCommandLine(Distribution distribution,
T config,
IExtractedFileSet exe) |
T |
getConfig() |
protected Map<String,String> |
getEnvironment(Distribution distribution,
T config,
IExtractedFileSet exe) |
protected static int |
getPidFromFile(File pidFile) |
long |
getProcessId() |
boolean |
isProcessRunning() |
protected void |
onAfterProcessStart(ProcessControl process,
IRuntimeConfig runtimeConfig) |
protected void |
onAfterProcessStop(T config,
IRuntimeConfig runtimeConfig) |
protected void |
onBeforeProcess(IRuntimeConfig runtimeConfig) |
protected void |
onBeforeProcessStart(ProcessBuilder processBuilder,
T config,
IRuntimeConfig runtimeConfig) |
protected File |
pidFile() |
protected File |
pidFile(File executeableFile) |
protected boolean |
sendKillToProcess() |
protected boolean |
sendTermToProcess() |
protected void |
setProcessId(int processId) |
void |
stop() |
protected abstract void |
stopInternal() |
protected void |
stopProcess() |
protected boolean |
tryKillToProcess() |
int |
waitFor() |
protected void |
writePidFile(File pidFile,
long pid) |
public static final int TIMEOUT
public AbstractProcess(Distribution distribution, T config, IRuntimeConfig runtimeConfig, E executable) throws IOException
IOExceptionprotected File pidFile()
public T getConfig()
protected void onBeforeProcess(IRuntimeConfig runtimeConfig) throws IOException
IOExceptionprotected void onBeforeProcessStart(ProcessBuilder processBuilder, T config, IRuntimeConfig runtimeConfig)
protected void onAfterProcessStart(ProcessControl process, IRuntimeConfig runtimeConfig) throws IOException
IOExceptionprotected abstract List<String> getCommandLine(Distribution distribution, T config, IExtractedFileSet exe) throws IOException
IOExceptionprotected Map<String,String> getEnvironment(Distribution distribution, T config, IExtractedFileSet exe)
protected abstract void stopInternal()
protected abstract void cleanupInternal()
protected void onAfterProcessStop(T config, IRuntimeConfig runtimeConfig)
protected final void stopProcess()
public int waitFor()
throws InterruptedException
InterruptedExceptionprotected void setProcessId(int processId)
protected boolean sendKillToProcess()
protected boolean sendTermToProcess()
protected boolean tryKillToProcess()
public boolean isProcessRunning()
public long getProcessId()
protected static int getPidFromFile(File pidFile) throws IOException
IOExceptionprotected void writePidFile(File pidFile, long pid) throws IOException
IOExceptionCopyright © 2015. All Rights Reserved.