import java.io.*;
import java.util.Date;

/**
 * The driver for an example that motivates the need for 
 * multi-threaded applications
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Driver
{
    /**
     * The entry point of the application
     *
     * @param args   The command line arguments
     */
    public static void main(String[] args) throws IOException
    {
       DailyDispatchHandler     daily;
       Dispatcher               dispatcher;
       RealTimeDispatchHandler  rt;
       String                   userInput;


       dispatcher = new Dispatcher(50);
        

       try 
       {
           daily = new DailyDispatchHandler(dispatcher, "dispatches.txt");
           daily.start();
       }
       catch (IOException ioe)
       {
           System.err.println("Unable to open daily dispatches.");
       }
       
        
       try
       {
           rt = new RealTimeDispatchHandler(dispatcher);
           rt.start();
       }
       catch (IOException ioe)
       {
           System.err.println("Unable to read from the console.");
       }
    }
}
