de.flapdoodle.embed.process.runtime
Class AbstractProcess<T extends ExecutableProcessConfig,E extends Executable<T,P>,P extends IStopable>

java.lang.Object
  extended by de.flapdoodle.embed.process.runtime.AbstractProcess<T,E,P>
All Implemented Interfaces:
IStopable

public abstract class AbstractProcess<T extends ExecutableProcessConfig,E extends Executable<T,P>,P extends IStopable>
extends Object
implements IStopable


Field Summary
static int TIMEOUT
           
 
Constructor Summary
AbstractProcess(Distribution distribution, T config, IRuntimeConfig runtimeConfig, E executable)
           
 
Method Summary
protected abstract  List<String> getCommandLine(Distribution distribution, T config, File exe)
           
 T getConfig()
           
protected  void onAfterProcessStart(ProcessControl process, IRuntimeConfig runtimeConfig)
           
protected  void onBeforeProcess(IRuntimeConfig runtimeConfig)
           
protected  void onBeforeProcessStart(ProcessBuilder processBuilder, T config2, IRuntimeConfig runtimeConfig)
           
protected  boolean sendKillToProcess()
           
protected  void setProcessId(int processId)
           
abstract  void stop()
           
protected  void stopProcess()
           
protected abstract  ISupportConfig supportConfig()
           
protected  boolean tryKillToProcess()
           
 int waitFor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMEOUT

public static final int TIMEOUT
See Also:
Constant Field Values
Constructor Detail

AbstractProcess

public AbstractProcess(Distribution distribution,
                       T config,
                       IRuntimeConfig runtimeConfig,
                       E executable)
                throws IOException
Throws:
IOException
Method Detail

getConfig

public T getConfig()

onBeforeProcess

protected void onBeforeProcess(IRuntimeConfig runtimeConfig)
                        throws IOException
Throws:
IOException

onBeforeProcessStart

protected void onBeforeProcessStart(ProcessBuilder processBuilder,
                                    T config2,
                                    IRuntimeConfig runtimeConfig)

onAfterProcessStart

protected void onAfterProcessStart(ProcessControl process,
                                   IRuntimeConfig runtimeConfig)
                            throws IOException
Throws:
IOException

getCommandLine

protected abstract List<String> getCommandLine(Distribution distribution,
                                               T config,
                                               File exe)
                                        throws IOException
Throws:
IOException

supportConfig

protected abstract ISupportConfig supportConfig()

stop

public abstract void stop()
Specified by:
stop in interface IStopable

stopProcess

protected final void stopProcess()

waitFor

public int waitFor()
            throws InterruptedException
Throws:
InterruptedException

setProcessId

protected void setProcessId(int processId)

sendKillToProcess

protected boolean sendKillToProcess()

tryKillToProcess

protected boolean tryKillToProcess()


Copyright © 2012. All Rights Reserved.