Esempio n. 1
0
  public static void main(String argv[]) {
    String queuecf = null;
    String requestq = null;
    if (argv.length == 2) {
      queuecf = argv[0];
      requestq = argv[1];
    } else {
      System.out.println("Invalid arguments. Should be: ");
      System.out.println("java QLender factory request_queue");
      System.exit(0);
    }

    QLender lender = new QLender(queuecf, requestq);

    try {
      // Run until enter is pressed
      BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
      System.out.println("QLender application started");
      System.out.println("Press enter to quit application");
      stdin.readLine();
      lender.exit();
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
Esempio n. 2
0
 private static void enter4quit(QLender lender) {
   try {
     // Run until enter is pressed
     BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
     System.out.println("QLender application started");
     System.out.println("Press enter to quit application");
     stdin.readLine();
     lender.exit();
   } catch (IOException ioe) {
     ioe.printStackTrace();
   }
 }