org.sonar.process.monitor
Class Monitor

java.lang.Object
  extended by org.sonar.process.monitor.Monitor

public class Monitor
extends Object


Method Summary
 void awaitTermination()
          Blocks until all processes are terminated
static Monitor create()
           
 Lifecycle.State getState()
           
 void start(List<JavaCommand> commands)
          Starts commands and blocks current thread until all processes are in state Lifecycle.State.STARTED.
 void stop()
          Blocks until all processes are terminated.
 void stopAsync()
          Asks for processes termination and returns without blocking until termination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Monitor create()

start

public void start(List<JavaCommand> commands)
Starts commands and blocks current thread until all processes are in state Lifecycle.State.STARTED.

Throws:
IllegalArgumentException - if commands list is empty
IllegalStateException - if already started or if at least one process failed to start. In this case all processes are terminated. No need to execute stop()

awaitTermination

public void awaitTermination()
Blocks until all processes are terminated


stop

public void stop()
Blocks until all processes are terminated.


stopAsync

public void stopAsync()
Asks for processes termination and returns without blocking until termination.


getState

public Lifecycle.State getState()


Copyright © 2009–2015 SonarSource. All rights reserved.