java.lang.Object | +--com.yellowpig.rod.app.watchdog.ProcessLauncher
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.)
RunnableLauncher
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 | |
ProcessLauncher()
|
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 |
|
Field Detail |
private static final int DELIM_CHAR
main(java.lang.String[])
private static final java.lang.String COMMENT_STR
Lines beginning with this string will be ignored.
main(java.lang.String[])
Constructor Detail |
public ProcessLauncher()
Method Detail |
public static void main(java.lang.String[] args)
Usage:
From the command line:Within your Java code:java com.yellowpig.rod.app.watchdog.ProcessLauncher <paramfile>where <paramfile> is the platform-specific path to a parameter file.com.yellowpig.rod.app.watchdog.ProcessLauncher.main((String[]){"paramfile"})Parameter files are composed of lines with the following format:
where<restartflag>DELIM_CHAR<command>Blank lines and lines beginning with COMMENT_STR are ignored.
- <restartflag>
- 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.)
- <command>
- is a platform-dependent command that launches the process to be monitored. (see java.lang.Runtime.exec(String))
args
- The command-line arguments.protected static void printBanner()
protected static void printUsage()