Package org.h2.test.db
Class TaskProcess
- java.lang.Object
-
- org.h2.test.db.TaskProcess
-
public class TaskProcess extends java.lang.ObjectA task that is run as an external process. This class communicates over standard input / output with the process. The standard error stream of the process is directly send to the standard error stream of this process.
-
-
Constructor Summary
Constructors Constructor Description TaskProcess(TaskDef taskDef)Construct a new task process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Kill the process if it still runs.java.lang.Stringreceive()Receive a message from the process over the standard output.voidsend(java.lang.String message)Send a message to the process over the standard input.voidstart(java.lang.String... args)Start the task with the given arguments.
-
-
-
Constructor Detail
-
TaskProcess
public TaskProcess(TaskDef taskDef)
Construct a new task process. The process is not started yet.- Parameters:
taskDef- the task
-
-
Method Detail
-
start
public void start(java.lang.String... args)
Start the task with the given arguments.- Parameters:
args- the arguments, or null
-
receive
public java.lang.String receive()
Receive a message from the process over the standard output.- Returns:
- the message
-
send
public void send(java.lang.String message)
Send a message to the process over the standard input.- Parameters:
message- the message
-
destroy
public void destroy()
Kill the process if it still runs.
-
-