Esempio n. 1
0
 public void run() {
   if (Thread.currentThread() != this.mt)
     throw (new RuntimeException("MainFrame is being run from an invalid context"));
   Thread ui = new HackThread(p, "Haven UI thread");
   ui.start();
   try {
     try {
       Session sess = null;
       while (true) {
         UI.Runner fun;
         if (sess == null) {
           Bootstrap bill = new Bootstrap(Config.defserv, Config.mainport);
           if ((Config.authuser != null) && (Config.authck != null)) {
             bill.setinitcookie(Config.authuser, Config.authck);
             Config.authck = null;
           }
           fun = bill;
           setTitle(String.format("Amish Paradise %s", version));
         } else {
           fun = new RemoteUI(sess);
           setTitle(String.format("Amish Paradise %s \u2013 %s", version, sess.username));
         }
         sess = fun.run(p.newui(sess));
       }
     } catch (InterruptedException e) {
     }
     savewndstate();
   } finally {
     ui.interrupt();
     dispose();
   }
 }
Esempio n. 2
0
  public static void main(final String[] args) throws IOException {
    logger.trace("Beginning startup");

    final JSMCore core = new JSMCore();

    try {
      // CKJM
      core.registerMetricCollection(new CKJM());
      // Package metrics
      core.registerMetricCollection(new PackageMetrics());
    } catch (MetricPreparationException e) {
      logger.error("Error loading metric definitions", e);
      if (!GraphicsEnvironment.isHeadless()) {
        JOptionPane.showMessageDialog(
            null,
            e.getMessage(),
            "Error loading metrics, see logs for more information",
            JOptionPane.ERROR_MESSAGE);
      }
      System.exit(-1);
    }

    Bootstrap.bootstrapJSM(core, args);
  }