public abstract class AbstractProcess<T extends IExecutableProcessConfig,E extends Executable<T,P>,P extends IStopable> extends java.lang.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 java.util.List<java.lang.String> |
getCommandLine(Distribution distribution,
T config,
IExtractedFileSet exe) |
T |
getConfig() |
protected java.util.Map<java.lang.String,java.lang.String> |
getEnvironment(Distribution distribution,
T config,
IExtractedFileSet exe) |
protected static int |
getPidFromFile(java.io.File pidFile) |
int |
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(java.lang.ProcessBuilder processBuilder,
T config,
IRuntimeConfig runtimeConfig) |
protected java.io.File |
pidFile() |
protected java.io.File |
pidFile(java.io.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(java.io.File pidFile,
int pid) |
public static final int TIMEOUT
public AbstractProcess(Distribution distribution, T config, IRuntimeConfig runtimeConfig, E executable) throws java.io.IOException
java.io.IOExceptionprotected java.io.File pidFile(java.io.File executeableFile)
protected java.io.File pidFile()
public T getConfig()
protected void onBeforeProcess(IRuntimeConfig runtimeConfig) throws java.io.IOException
java.io.IOExceptionprotected void onBeforeProcessStart(java.lang.ProcessBuilder processBuilder,
T config,
IRuntimeConfig runtimeConfig)
protected void onAfterProcessStart(ProcessControl process, IRuntimeConfig runtimeConfig) throws java.io.IOException
java.io.IOExceptionprotected abstract java.util.List<java.lang.String> getCommandLine(Distribution distribution, T config, IExtractedFileSet exe) throws java.io.IOException
java.io.IOExceptionprotected java.util.Map<java.lang.String,java.lang.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 java.lang.InterruptedException
java.lang.InterruptedExceptionprotected void setProcessId(int processId)
protected boolean sendKillToProcess()
protected boolean sendTermToProcess()
protected boolean tryKillToProcess()
public boolean isProcessRunning()
public int getProcessId()
protected static int getPidFromFile(java.io.File pidFile)
throws java.io.IOException
java.io.IOExceptionprotected void writePidFile(java.io.File pidFile,
int pid)
throws java.io.IOException
java.io.IOExceptionCopyright © 2014. All Rights Reserved.