changeset 2171:3c4a53467c72

Centralized and increased timeouts to give slow-loading applets enough time to load.
author Deepak Bhole <dbhole@redhat.com>
date Mon, 22 Feb 2010 16:54:32 -0500
parents cf649a549a40
children e84a0f2d1198
files ChangeLog plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Feb 19 14:19:25 2010 +0000
+++ b/ChangeLog	Mon Feb 22 16:54:32 2010 -0500
@@ -1,3 +1,8 @@
+2010-02-22  Deepak Bhole <dbhole@redhat.com>
+
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: Centralized
+	and increased timeouts to give slow-loading applets enough time to load.
+
 2010-02-19 Andrew John Hughes  <ahughes@redhat.com>
 
 	* acinclude.m4:
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Fri Feb 19 14:19:25 2010 +0000
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Mon Feb 22 16:54:32 2010 -0500
@@ -177,7 +177,7 @@
          Applet a;
 
          // Wait for panel to come alive
-         int maxWait = 5000; // wait 5 seconds max for panel to come alive
+         int maxWait = PluginAppletViewer.APPLET_TIMEOUT; // wait for panel to come alive
          int wait = 0;
          while ((panel == null) || (!((NetxPanel) panel).isAlive() && wait < maxWait)) {
               try {
@@ -368,6 +368,8 @@
      private long handle = 0;
      private WindowListener windowEventListener = null;
      private AppletEventListener appletEventListener = null;
+     
+     public static final int APPLET_TIMEOUT = 60000;
 
      /**
       * Null constructor to allow instantiation via newInstance()
@@ -613,7 +615,7 @@
                  if (message.startsWith("handle")) {
 
                      PluginDebug.debug("handle command waiting for applet to complete loading.");
-                     int maxWait = 10000; // wait 10 seconds max for applet to fully load
+                     int maxWait = APPLET_TIMEOUT; // wait for applet to fully load
                      int wait = 0;
                      while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) &&
                              (wait < maxWait)) {
@@ -660,7 +662,7 @@
          if (message.startsWith("width")) {
 
              // Wait for panel to come alive
-             int maxWait = 5000; // wait 5 seconds max for panel to come alive
+             int maxWait = APPLET_TIMEOUT; // wait for panel to come alive
              int wait = 0;
              while (!status.get(identifier).equals(PAV_INIT_STATUS.INIT_COMPLETE) && wait < maxWait) {
                   try {
@@ -721,7 +723,7 @@
              Object o;
 
              // Wait for panel to come alive
-             int maxWait = 5000; // wait 5 seconds max for panel to come alive
+             int maxWait = APPLET_TIMEOUT; // wait for panel to come alive
              int wait = 0;
              while ((panel == null) || (!((NetxPanel) panel).isAlive() && wait < maxWait)) {
                   try {