Main class

The main method takes the name of the directory from the command line argument. It treats this as relative to the current working directory. It uses a separate method from the same class to read the set of configurations from the files in the directory and then starts the control daemon. The following code if the main method of the program:

    public static void main(String[] args) throws IOException, 
     InterruptedException  
    {      // DemoOutput.out() simulated - implementation no shown      DemoOutput.out(new File(".").getAbsolutePath().toString());      if (args.length == 0)    {        System.err.println("Usage: daemon directory");        System.exit(-1);      }      Set<Parameters> params = parametersSetFrom(args[0]);      Thread t = new Thread(new ControlDaemon(params)); t.start(); ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.