Пример #1
0
  /**
   * {@inheritDoc}
   *
   * @see java.lang.Runnable#run()
   */
  public void run() {
    try {
      tokenizer = new Tokenizer(new Scanner(new InputStreamReader(System.in)));

      try {
        Arguments args;

        while ((args = tokenizer.read()) != null) {
          new Process(this, null, args, System.in, System.out, System.err).execute();
        }
      } finally {
        tokenizer.close();
      }
    } catch (IOException e) {
      e.printStackTrace(System.err);
    } finally {
      tokenizer = null;
    }
  }
Пример #2
0
  /** Stops the console. */
  public void stop() {
    if (tokenizer == null) {
      return;
    }

    try {
      tokenizer.close();
    } catch (IOException e) {
      // ignore
    } finally {
      tokenizer = null;
    }
  }