org.sonar.process
Class ProcessCommands
java.lang.Object
org.sonar.process.ProcessCommands
public class ProcessCommands
- extends Object
Process inter-communication to :
- share status of child process
- stop child process
It relies on files shared by both processes. Following alternatives were considered but not selected :
- JMX beans over RMI: network issues (mostly because of Java reverse-DNS) + requires to configure and open a new port
- simple socket protocol: same drawbacks are RMI connection
- java.lang.Process#destroy(): shutdown hooks are not executed on some OS (mostly MSWindows)
- execute OS-specific commands (for instance kill on *nix): OS-specific, so hell to support. Moreover how to get identify a process ?
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProcessCommands
public ProcessCommands(File directory,
String processKey)
prepare
public void prepare()
endWatch
public void endWatch()
isReady
public boolean isReady()
setReady
public void setReady()
- To be executed by child process to declare that it's ready
askForStop
public void askForStop()
- To be executed by monitor process to ask for child process termination
askedForStop
public boolean askedForStop()
Copyright © 2009–2014 SonarSource. All rights reserved.