public class NodeCommand extends Object
NodeCommandBuilder to create instance of this class.
Once created you can call start() to start external process, waitFor() to wait until process
terminates and destroy() to kill the process.
Standard and error output are consumed asynchronously in separate threads and each line is supplied to the
consumer set via NodeCommandBuilder.outputConsumer(Consumer) or NodeCommandBuilder.errorConsumer(Consumer).
When no consumers are set, by default it will use logger to log output of external process - standard output at INFO level
and error output at ERROR level.| Modifier and Type | Method and Description |
|---|---|
static NodeCommandBuilder |
builder() |
void |
destroy()
Destroy external process
|
void |
start()
Start external NodeJS process
|
String |
toString() |
int |
waitFor()
Wait for external process to terminate
|
public void start()
NodeCommandException - when start of the external process failspublic int waitFor()
public void destroy()
public static NodeCommandBuilder builder()
Copyright © 2011–2018 SonarSource and Eriks Nukis. All rights reserved.