home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / nav40.z / java40.jar / netscape / security / DialogCreator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-13  |  1.7 KB  |  72 lines

  1. package netscape.security;
  2.  
  3. class DialogCreator extends Thread {
  4.    private static Object lock = new Object();
  5.    private static boolean dlgCreatorThreadStarted;
  6.    private static UserAwtDialog theUserAwtDialog = null;
  7.    private static Thread dlgCreatorThread = null;
  8.  
  9.    DialogCreator() {
  10.       if (dlgCreatorThread == null) {
  11.          dlgCreatorThread = this;
  12.       }
  13.  
  14.    }
  15.  
  16.    static void createAwtDialogsInSeparateThread() {
  17.       Object var0 = lock;
  18.       synchronized(var0){}
  19.  
  20.       try {
  21.          if (dlgCreatorThread == null) {
  22.             throw new NullPointerException("Dialog creator thread not created");
  23.          }
  24.  
  25.          if (theUserAwtDialog == null && !dlgCreatorThreadStarted) {
  26.             dlgCreatorThread.start();
  27.             dlgCreatorThreadStarted = true;
  28.          }
  29.  
  30.          while(theUserAwtDialog == null) {
  31.             try {
  32.                lock.wait();
  33.             } catch (Throwable var5) {
  34.                System.out.println("interrupted during AWT based security dialog creation!");
  35.                var5.printStackTrace(System.out);
  36.             }
  37.          }
  38.       } catch (Throwable var6) {
  39.          throw var6;
  40.       }
  41.  
  42.    }
  43.  
  44.    public void run() {
  45.       if (theUserAwtDialog == null) {
  46.          try {
  47.             theUserAwtDialog = new UserAwtDialog();
  48.          } catch (Exception var5) {
  49.             System.err.println("Error: new UserAwtDialog() returned null object");
  50.             ((Throwable)var5).printStackTrace(System.out);
  51.             throw new NullPointerException("Security Dialog not created");
  52.          }
  53.       }
  54.  
  55.       if (theUserAwtDialog != null) {
  56.          Object var1 = lock;
  57.          synchronized(var1){}
  58.  
  59.          try {
  60.             lock.notifyAll();
  61.          } catch (Throwable var4) {
  62.             throw var4;
  63.          }
  64.  
  65.       }
  66.    }
  67.  
  68.    static UserAwtDialog getUserAwtDialog() {
  69.       return theUserAwtDialog;
  70.    }
  71. }
  72.