/*****************************************************************************
* This is an application that will tie into a JESS (Java Expert System Shell)
* script to aid a user in the selection of new hardware components for a home
* built computer system.
*
* @author Michael Wales
* @version Initial Prototype V0.0
*****************************************************************************/
public class ComputerAdvice
{
   /*************************************************************************
   * This is the function that is first executed when ComputerAdvice starts.
   * The functionality is currently in two modes.  There is a normal mode 
   * where ComputerAdvice waits for a connection from JESS.  The second mode
   * is for debugging purposes.  In the second mode, ComputerAdvice will 
   * emulate a JESS connection, and the user can type in commands to send to
   * another instance of ComputerAdvice for testing purposes.
   *
   * @param args These are the command line parameters you pass ComputerAdvice.
   *   Pass it 0 parameters to wait for a connection from JESS, pass it 1 
   *   parameter (doesn't matter what) for it to emulate JESS.
   *************************************************************************/
   public static void main (String args[])
   {
      if (args.length == 1)
      {
         if (args[0].equals( "webserver") )
         {
            System.out.println("Webserver interface starting");
            JessInterfaceToWeb JessConn = new JessInterfaceToWeb();
            JessConn.acceptJESSConnection();
         }
         else
         {
            JessInterface JessConn = new JessInterface();
            JessConn.emulateJess();
         }
            
         System.exit(0);
      }
      
      JessInterface JessConn = new JessInterface();
      JessConn.acceptConnection();      
      
   }
   
   
}
