Class NodeCommand


  • public class NodeCommand
    extends Object
    Represents invocation of external NodeJS process. Use 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.
    • Method Detail

      • start

        public void start()
        Start external NodeJS process
        Throws:
        NodeCommandException - when start of the external process fails
      • waitFor

        public int waitFor()
        Wait for external process to terminate
        Returns:
        exit value of the external process
      • getActualNodeVersion

        public org.sonar.api.utils.Version getActualNodeVersion()