home *** CD-ROM | disk | FTP | other *** search
- package netscape.security;
-
- class DialogCreator extends Thread {
- private static Object lock = new Object();
- private static boolean dlgCreatorThreadStarted;
- private static UserAwtDialog theUserAwtDialog = null;
- private static Thread dlgCreatorThread = null;
-
- DialogCreator() {
- if (dlgCreatorThread == null) {
- dlgCreatorThread = this;
- }
-
- }
-
- static void createAwtDialogsInSeparateThread() {
- Object var0 = lock;
- synchronized(var0){}
-
- try {
- if (dlgCreatorThread == null) {
- throw new NullPointerException("Dialog creator thread not created");
- }
-
- if (theUserAwtDialog == null && !dlgCreatorThreadStarted) {
- dlgCreatorThread.start();
- dlgCreatorThreadStarted = true;
- }
-
- while(theUserAwtDialog == null) {
- try {
- lock.wait();
- } catch (Throwable var5) {
- System.out.println("interrupted during AWT based security dialog creation!");
- var5.printStackTrace(System.out);
- }
- }
- } catch (Throwable var6) {
- throw var6;
- }
-
- }
-
- public void run() {
- if (theUserAwtDialog == null) {
- try {
- theUserAwtDialog = new UserAwtDialog();
- } catch (Exception var5) {
- System.err.println("Error: new UserAwtDialog() returned null object");
- ((Throwable)var5).printStackTrace(System.out);
- throw new NullPointerException("Security Dialog not created");
- }
- }
-
- if (theUserAwtDialog != null) {
- Object var1 = lock;
- synchronized(var1){}
-
- try {
- lock.notifyAll();
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
- }
-
- static UserAwtDialog getUserAwtDialog() {
- return theUserAwtDialog;
- }
- }
-