Make your own free website on
Class ProcessLauncher


public class ProcessLauncher
extends java.lang.Object

A utility for launching and monitoring processes. A launched process can be automatically restarted when it goes down.

See the documentation for the main method for information on how to use the ProcessLauncher.

You can also view the source for this class.

This program and its documentation are copyright © 1999 Rodney Waldhoff. You must agree to the licensing terms in order to read, use, distribute or deploy this software or its documentation. (Don't worry, it's Open Source.)

1.0 [1999.03.23]
Rodney Waldhoff <>
See Also:

Field Summary
private static java.lang.String COMMENT_STR
          The string that starts a comment line.
private static int DELIM_CHAR
          The delimiter that separates the "restart flag" from the command to execute.
Constructor Summary
Method Summary
static void main(java.lang.String[] args)
          The application's main method.
protected static void printBanner()
          Outputs the application's "banner" to System.out.
protected static void printUsage()
          Outputs the application's "help" to System.out.
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Field Detail


private static final int DELIM_CHAR
The delimiter that separates the "restart flag" from the command to execute.

See Also:


private static final java.lang.String COMMENT_STR
The string that starts a comment line.

Lines beginning with this string will be ignored.

See Also:
Constructor Detail


public ProcessLauncher()
Method Detail


public static void main(java.lang.String[] args)
The application's main method. Launches and optionally monitors/restarts a set of processes, as specified by a parameter file.


From the command line:
java <paramfile>
Within your Java code:[]){"paramfile"})
where <paramfile> is the platform-specific path to a parameter file.

Parameter files are composed of lines with the following format:

indicates whether or not to restart the process when it closes. (The case-insenstive string TRUE indicates that the process should be restarted, all other strings cause the process to be forgetten about once started.)
is a platform-dependent command that launches the process to be monitored. (see java.lang.Runtime.exec(String))
Blank lines and lines beginning with COMMENT_STR are ignored.

args - The command-line arguments.


protected static void printBanner()
Outputs the application's "banner" to System.out.


protected static void printUsage()
Outputs the application's "help" to System.out.