A few years ago I made something like this myself. I wrote a class that started a thread to listen on a TCP/IP port. Each of the processes to be monitored started this thread (each using a different TCP/IP port, ofcourse). The monitoring program could connect to that port and send some simple commands (with a very small application protocol that I invented myself) to see if the program was running and to get some statistics.
If I'd have to do something like that now, I'd probably use JConsole and program a few MBeans into my application. JConsole is a tool added in Java 5.0 to monitor applications: Using JConsole to Monitor Applications. [ November 09, 2006: Message edited by: Jesper Young ]