com.pelzer.util
Class PID
java.lang.Object
com.pelzer.util.PID
public class PID
- extends Object
Wrapper around the unix concept of a process identifier. Only works if you're
running on a system that has perl in the path.
|
Constructor Summary |
PID()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PID
public PID()
getCurrentPID
public static int getCurrentPID()
- Returns:
- the pid of the current JVM. Requires that 'perl' be in the path
otherwise returns -1
readPID
public static int readPID(File pidFile)
throws IOException,
NumberFormatException
- Returns:
- the parsed int read from the given pid file
- Throws:
IOException
NumberFormatException
isPIDAlive
public static boolean isPIDAlive(int pid)
throws IOException
- Returns true if the given pid is alive. Requires /bin/ps (ie UNIX)
- Throws:
IOException
main
public static void main(String[] args)
Copyright © 2012. All Rights Reserved.