This final section provides a sample process control application to demonstrate this chapter's content. The functionality of the application is very simple. It reads from a series of configuration file parameters how to start some processes and then, if any of them stops, it tries to restart the process.
This sample application can be used as a starting point for real-world applications. You can extend the set of parameters of the process with environment variable specifications. You can also add a default directory for the process, input, and output redirection, and even how much CPU consumption a process is allowed without the controlling application killing and restarting it.
The application consists of four classes:
- Main: This class contains the public static void main method and is used to start up the daemon.
- Parameters: This...