home *** CD-ROM | disk | FTP | other *** search
/ Performance Now / PFE4.iso / worldnet / ns3230d / disk2 / java.z / java_30 / netscape / applet / MozillaAppletContext.class (.txt) < prev   
Encoding:
Java Class File  |  1996-08-15  |  16.2 KB  |  700 lines

  1. package netscape.applet;
  2.  
  3. import java.applet.Applet;
  4. import java.applet.AppletContext;
  5. import java.applet.AudioClip;
  6. import java.awt.Image;
  7. import java.awt.Toolkit;
  8. import java.awt.Window;
  9. import java.io.PrintStream;
  10. import java.net.MalformedURLException;
  11. import java.net.URL;
  12. import java.util.Enumeration;
  13. import java.util.Hashtable;
  14. import java.util.Vector;
  15. import netscape.net.URLStreamHandlerFactory;
  16. import sun.awt.image.URLImageSource;
  17.  
  18. class MozillaAppletContext implements AppletContext {
  19.    int frameMWContext;
  20.    Mapping appletFrames;
  21.    Hashtable imageCache;
  22.    Hashtable audioClipCache;
  23.    URL documentURL;
  24.    Integer contextID;
  25.    static Console console;
  26.    static int totalApplets;
  27.    static int trimThreshold;
  28.    static boolean noisyTrimming;
  29.    static Mapping appletContexts = new Mapping();
  30.    static int debug;
  31.  
  32.    MozillaAppletContext(Integer contextID) {
  33.       this.contextID = contextID;
  34.       this.appletFrames = new Mapping();
  35.       this.imageCache = new Hashtable();
  36.       this.audioClipCache = new Hashtable();
  37.    }
  38.  
  39.    static void indent(PrintStream out, int i) {
  40.       while(true) {
  41.          --i;
  42.          if (i < 0) {
  43.             return;
  44.          }
  45.  
  46.          out.print(" ");
  47.       }
  48.    }
  49.  
  50.    void dumpState(PrintStream out, int i) {
  51.       indent(out, i);
  52.       out.println("MozillaAppletContext #frames=" + this.appletFrames.size() + " #images=" + this.imageCache.size() + " #audioClips=" + this.audioClipCache.size() + " url=" + this.documentURL);
  53.       int size = this.appletFrames.size();
  54.  
  55.       for(int j = 0; j < size; ++j) {
  56.          EmbeddedAppletFrame eaf = (EmbeddedAppletFrame)this.appletFrames.elementAt(j);
  57.          eaf.dumpState(out, i + 1);
  58.       }
  59.  
  60.       if (this.imageCache.size() > 0) {
  61.          indent(out, i + 1);
  62.          out.println("image cache:");
  63.          Enumeration e = this.imageCache.keys();
  64.  
  65.          while(e.hasMoreElements()) {
  66.             URL u = (URL)e.nextElement();
  67.             indent(out, i + 2);
  68.             out.println(u.toString());
  69.          }
  70.       }
  71.  
  72.       if (this.audioClipCache.size() > 0) {
  73.          indent(out, i + 1);
  74.          out.println("audio clip cache:");
  75.          Enumeration e = this.audioClipCache.keys();
  76.  
  77.          while(e.hasMoreElements()) {
  78.             URL u = (URL)e.nextElement();
  79.             indent(out, i + 2);
  80.             out.println(u.toString());
  81.          }
  82.       }
  83.  
  84.    }
  85.  
  86.    void destroy() {
  87.       if (debug > 0) {
  88.          System.err.println("#   destroy acx=" + this + " frameMWContext=" + this.frameMWContext);
  89.       }
  90.  
  91.       this.destroyApplets();
  92.       this.frameMWContext = 0;
  93.       this.appletFrames = null;
  94.       this.imageCache = null;
  95.       this.audioClipCache = null;
  96.       appletContexts.remove(this.contextID);
  97.    }
  98.  
  99.    public AudioClip getAudioClip(URL url) {
  100.       AudioClip clip = lookupAudioClip(this, url);
  101.       return clip;
  102.    }
  103.  
  104.    public Image getImage(URL url) {
  105.       Image img = lookupImage(this, url);
  106.       return img;
  107.    }
  108.  
  109.    public Applet getApplet(String name) {
  110.       name = name.toLowerCase();
  111.       int size = this.appletFrames.size();
  112.  
  113.       for(int i = 0; i < size; ++i) {
  114.          EmbeddedAppletFrame frame = (EmbeddedAppletFrame)this.appletFrames.elementAt(i);
  115.          if (name.equals(frame.applet.getParameter("name"))) {
  116.             return frame.applet;
  117.          }
  118.       }
  119.  
  120.       return null;
  121.    }
  122.  
  123.    public Enumeration getApplets() {
  124.       int size = this.appletFrames.size();
  125.       Vector v = new Vector(size);
  126.  
  127.       for(int i = 0; i < size; ++i) {
  128.          EmbeddedAppletFrame frame = (EmbeddedAppletFrame)this.appletFrames.elementAt(i);
  129.          v.addElement(frame.applet);
  130.       }
  131.  
  132.       return v.elements();
  133.    }
  134.  
  135.    public void showDocument(URL url) {
  136.       this.showDocument(url, "_top");
  137.    }
  138.  
  139.    public void showDocument(URL url, String target) {
  140.       this.pShowDocument(url.toExternalForm(), (String)null, target);
  141.    }
  142.  
  143.    public void showStatus(String status) {
  144.       this.pShowStatus(status);
  145.    }
  146.  
  147.    public void mochaOnLoad(int result) {
  148.       this.pMochaOnLoad(result);
  149.    }
  150.  
  151.    private native void pShowDocument(String var1, String var2, String var3);
  152.  
  153.    private native void pShowStatus(String var1);
  154.  
  155.    private native void pMochaOnLoad(int var1);
  156.  
  157.    static synchronized AudioClip lookupAudioClip(MozillaAppletContext incx, URL url) {
  158.       int size = appletContexts.size();
  159.  
  160.       for(int i = 0; i < size; ++i) {
  161.          MozillaAppletContext acx = (MozillaAppletContext)appletContexts.elementAt(i);
  162.          Object clip = acx.audioClipCache.get(url);
  163.          if (clip != null) {
  164.             return (AudioClip)clip;
  165.          }
  166.       }
  167.  
  168.       AudioClip clip = new AppletAudioClip(url);
  169.       incx.audioClipCache.put(url, clip);
  170.       if (debug > 0) {
  171.          System.err.println("# New audio clip: " + url);
  172.       }
  173.  
  174.       return clip;
  175.    }
  176.  
  177.    static synchronized Image lookupImage(MozillaAppletContext incx, URL url) {
  178.       int size = appletContexts.size();
  179.  
  180.       for(int i = 0; i < size; ++i) {
  181.          MozillaAppletContext acx = (MozillaAppletContext)appletContexts.elementAt(i);
  182.          Object image = acx.imageCache.get(url);
  183.          if (image != null) {
  184.             return (Image)image;
  185.          }
  186.       }
  187.  
  188.       Image image;
  189.       try {
  190.          URLImageSource source = new URLImageSource(url);
  191.          image = Toolkit.getDefaultToolkit().createImage(source);
  192.          incx.imageCache.put(url, image);
  193.          if (debug > 0) {
  194.             System.err.println("# New image: " + url);
  195.          }
  196.       } catch (Exception var6) {
  197.          image = null;
  198.       }
  199.  
  200.       return image;
  201.    }
  202.  
  203.    synchronized void initApplet(int appletID, String docURL, Hashtable params) {
  204.       if (debug > 0) {
  205.          System.err.println("#   initApplet: appletID=" + appletID);
  206.       }
  207.  
  208.       try {
  209.          this.documentURL = new URL(docURL);
  210.       } catch (MalformedURLException var17) {
  211.          if (debug > 0) {
  212.             System.err.println("#     Malformed documentURL: " + docURL);
  213.          }
  214.  
  215.          this.mochaOnLoad(-1);
  216.          return;
  217.       }
  218.  
  219.       String codebase = (String)params.get("codebase");
  220.       if (codebase == null) {
  221.          int tail = docURL.lastIndexOf(47) + 1;
  222.          codebase = docURL.substring(0, tail);
  223.       } else {
  224.          if (!codebase.endsWith("/")) {
  225.             codebase = codebase + "/";
  226.          }
  227.  
  228.          try {
  229.             URL u = new URL(this.documentURL, codebase);
  230.             codebase = u.toString();
  231.             int tail = codebase.lastIndexOf(47) + 1;
  232.             if (tail != codebase.length() - 1) {
  233.                codebase = codebase.substring(0, tail);
  234.             }
  235.          } catch (MalformedURLException var16) {
  236.          }
  237.       }
  238.  
  239.       params.put("codebase", codebase);
  240.       URL codebaseURL = this.documentURL;
  241.  
  242.       try {
  243.          codebaseURL = new URL(codebase);
  244.       } catch (MalformedURLException var15) {
  245.       }
  246.  
  247.       String archive = (String)params.get("archive");
  248.       if (archive == null) {
  249.          int tail = docURL.lastIndexOf(47) + 1;
  250.          archive = docURL.substring(0, tail);
  251.       } else {
  252.          try {
  253.             int commaIndex = archive.indexOf(44);
  254.             if (commaIndex != -1) {
  255.                archive = archive.substring(0, commaIndex);
  256.             }
  257.  
  258.             URL u = new URL(codebaseURL, archive);
  259.             archive = u.toString();
  260.          } catch (MalformedURLException var14) {
  261.          }
  262.       }
  263.  
  264.       params.put("archive", archive);
  265.       URL archiveURL = codebaseURL;
  266.  
  267.       try {
  268.          archiveURL = new URL(archive);
  269.       } catch (MalformedURLException var13) {
  270.       }
  271.  
  272.       Integer frameKey = new Integer(appletID);
  273.       EmbeddedAppletFrame frame = new EmbeddedAppletFrame(this.documentURL, codebaseURL, archiveURL, params, this, frameKey);
  274.       this.appletFrames.put(frameKey, frame);
  275.       ++totalApplets;
  276.       if (debug > 0) {
  277.          System.err.println("#     total applets=" + totalApplets);
  278.       }
  279.  
  280.       if (debug > 0) {
  281.          String p = "";
  282.  
  283.          Object key;
  284.          for(Enumeration e = params.keys(); e.hasMoreElements(); p = p + (String)key + "=" + (String)params.get(key) + " ") {
  285.             key = e.nextElement();
  286.          }
  287.  
  288.          System.err.println("#     New applet: " + appletID + " at " + codebaseURL + " " + p);
  289.       }
  290.  
  291.       frame.start();
  292.       ((Window)frame).pack();
  293.       ((Window)frame).show();
  294.       frame.sendEvent(1);
  295.       frame.sendEvent(2);
  296.    }
  297.  
  298.    EmbeddedAppletFrame getAppletFrame(Integer appletID) {
  299.       EmbeddedAppletFrame frame = (EmbeddedAppletFrame)this.appletFrames.get(appletID);
  300.       if (frame == null && debug > 0) {
  301.          System.err.println("#   Warning: AppletFrame not found for appletID " + appletID);
  302.       }
  303.  
  304.       return frame;
  305.    }
  306.  
  307.    synchronized void startApplet(int appletID) {
  308.       if (debug > 0) {
  309.          System.err.println("#   startApplet: appletID=" + appletID);
  310.       }
  311.  
  312.       EmbeddedAppletFrame frame = this.getAppletFrame(new Integer(appletID));
  313.       if (frame == null) {
  314.          System.err.println("---> applet must have been pruned: " + appletID + " on " + this.documentURL);
  315.       } else {
  316.          frame.inHistory = false;
  317.          frame.sendEvent(3);
  318.       }
  319.    }
  320.  
  321.    synchronized void stopApplet(int appletID) {
  322.       if (debug > 0) {
  323.          System.err.println("#   stopApplet: appletID=" + appletID);
  324.       }
  325.  
  326.       EmbeddedAppletFrame frame = this.getAppletFrame(new Integer(appletID));
  327.       if (frame != null) {
  328.          frame.inHistory = true;
  329.          frame.sendEvent(4);
  330.          trimApplets();
  331.       }
  332.    }
  333.  
  334.    synchronized void destroyApplet(Integer appletID) {
  335.       if (noisyTrimming && debug > 0) {
  336.          System.err.println("#   destroyApplet: appletID=" + appletID);
  337.       }
  338.  
  339.       EmbeddedAppletFrame frame = this.getAppletFrame(appletID);
  340.       if (frame != null) {
  341.          --totalApplets;
  342.          if (noisyTrimming && debug > 0) {
  343.             System.err.println("#     total applets=" + totalApplets);
  344.          }
  345.  
  346.          if (!noisyTrimming) {
  347.             frame.noisy = false;
  348.          }
  349.  
  350.          this.appletFrames.remove(appletID);
  351.          ThreadGroup group = frame.handler.getThreadGroup();
  352.          synchronized(group){}
  353.  
  354.          try {
  355.             frame.sendEvent(4);
  356.             frame.sendEvent(5);
  357.             frame.sendEvent(0);
  358.  
  359.             try {
  360.                group.wait(1000L);
  361.             } catch (InterruptedException var11) {
  362.             }
  363.  
  364.             if (group.activeCount() > 0) {
  365.                SecurityManager.setScopePermission();
  366.                group.stop();
  367.                SecurityManager.resetScopePermission();
  368.  
  369.                try {
  370.                   group.wait(1000L);
  371.                } catch (InterruptedException var10) {
  372.                }
  373.             }
  374.  
  375.             try {
  376.                SecurityManager.setScopePermission();
  377.                group.destroy();
  378.                SecurityManager.resetScopePermission();
  379.             } catch (Exception var9) {
  380.             }
  381.          } catch (Throwable var12) {
  382.             throw var12;
  383.          }
  384.  
  385.       }
  386.    }
  387.  
  388.    synchronized void iconifyApplets() {
  389.       if (debug > 0) {
  390.          System.err.println("#   iconifyApplets");
  391.       }
  392.  
  393.       int size = this.appletFrames.size();
  394.  
  395.       for(int i = 0; i < size; ++i) {
  396.          EmbeddedAppletFrame frame = (EmbeddedAppletFrame)this.appletFrames.elementAt(i);
  397.          if (debug > 0) {
  398.             System.err.println("#     iconifyApplets: stopping appletID " + frame.pData);
  399.          }
  400.  
  401.          frame.sendEvent(4);
  402.       }
  403.  
  404.    }
  405.  
  406.    synchronized void uniconifyApplets() {
  407.       if (debug > 0) {
  408.          System.err.println("#   uniconifyApplets");
  409.       }
  410.  
  411.       int size = this.appletFrames.size();
  412.  
  413.       for(int i = 0; i < size; ++i) {
  414.          EmbeddedAppletFrame frame = (EmbeddedAppletFrame)this.appletFrames.elementAt(i);
  415.          if (debug > 0) {
  416.             System.err.println("#     uniconifyApplets: starting appletID " + frame.pData);
  417.          }
  418.  
  419.          frame.sendEvent(3);
  420.       }
  421.  
  422.    }
  423.  
  424.    synchronized Object reflectApplet(int appletID) {
  425.       if (debug > 0) {
  426.          System.err.println("#   reflectApplet: appletID=" + appletID);
  427.       }
  428.  
  429.       EmbeddedAppletFrame frame = this.getAppletFrame(new Integer(appletID));
  430.       return frame == null ? null : frame.applet;
  431.    }
  432.  
  433.    synchronized void destroyApplets() {
  434.       if (debug > 0) {
  435.          System.err.println("#   destroyApplets");
  436.       }
  437.  
  438.       int size = this.appletFrames.size();
  439.  
  440.       for(int i = size - 1; i >= 0; --i) {
  441.          Integer frame = (Integer)this.appletFrames.keyAt(i);
  442.          this.destroyApplet(frame);
  443.       }
  444.  
  445.    }
  446.  
  447.    static void init() {
  448.       console = new Console();
  449.       System.setProperties(new AppletProperties());
  450.       URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory());
  451.       System.setSecurityManager(new AppletSecurity());
  452.    }
  453.  
  454.    static void setConsoleState(int newstate) {
  455.       setConsoleState0(newstate);
  456.    }
  457.  
  458.    static native void setConsoleState0(int var0);
  459.  
  460.    static void showConsole() {
  461.       console.show();
  462.    }
  463.  
  464.    static void hideConsole() {
  465.       console.hide();
  466.    }
  467.  
  468.    static int trimApplets(int numberToTrim, boolean trimOnlyStoppedApplets) {
  469.       int numberTrimmed = trimApplets1(numberToTrim, true);
  470.       if (numberTrimmed < numberToTrim && !trimOnlyStoppedApplets) {
  471.          numberTrimmed += trimApplets1(numberToTrim - numberTrimmed, false);
  472.       }
  473.  
  474.       return numberTrimmed;
  475.    }
  476.  
  477.    static int trimApplets1(int numberToTrim, boolean trimOnlyStoppedApplets) {
  478.       int numberTrimmed;
  479.       for(numberTrimmed = 0; numberToTrim-- > 0; ++numberTrimmed) {
  480.          long oldestTime = -1L;
  481.          EmbeddedAppletFrame oldestFrame = null;
  482.          MozillaAppletContext contextOfOldest = null;
  483.          int size = appletContexts.size();
  484.  
  485.          for(int i = 0; i < size; ++i) {
  486.             MozillaAppletContext acx = (MozillaAppletContext)appletContexts.elementAt(i);
  487.             int size2 = acx.appletFrames.size();
  488.  
  489.             for(int j = 0; j < size2; ++j) {
  490.                EmbeddedAppletFrame frame = (EmbeddedAppletFrame)acx.appletFrames.elementAt(j);
  491.                if ((!trimOnlyStoppedApplets || frame.inHistory) && (oldestTime == -1L || frame.timestamp < oldestTime)) {
  492.                   oldestTime = frame.timestamp;
  493.                   oldestFrame = frame;
  494.                   contextOfOldest = acx;
  495.                }
  496.             }
  497.          }
  498.  
  499.          if (oldestFrame == null) {
  500.             if (noisyTrimming && debug > 0) {
  501.                System.err.println("# No stopped applets to prune.");
  502.             }
  503.  
  504.             return numberTrimmed;
  505.          }
  506.  
  507.          try {
  508.             if (noisyTrimming) {
  509.                Applet applet = oldestFrame.applet;
  510.                String name = null;
  511.                if (applet != null) {
  512.                   name = applet.getParameter("name");
  513.                }
  514.  
  515.                if (name == null) {
  516.                   name = applet.getClass().getName().toString();
  517.                }
  518.  
  519.                System.err.println("# Pruning applet " + name + " from " + contextOfOldest.documentURL + " to save memory.");
  520.                if (debug > 0) {
  521.                   System.err.println("#   Pruning appletID=" + oldestFrame.pData + " contextID=" + contextOfOldest.contextID + " applet=" + oldestFrame.applet);
  522.                }
  523.             }
  524.          } catch (Throwable var14) {
  525.          }
  526.  
  527.          try {
  528.             contextOfOldest.destroyApplet(oldestFrame.appletID);
  529.          } catch (Throwable var13) {
  530.          }
  531.       }
  532.  
  533.       return numberTrimmed;
  534.    }
  535.  
  536.    static void trimApplets() {
  537.       trimApplets(totalApplets - trimThreshold, true);
  538.    }
  539.  
  540.    static MozillaAppletContext getAppletContext(int contextID) {
  541.       Integer key = new Integer(contextID);
  542.       MozillaAppletContext context = (MozillaAppletContext)appletContexts.get(key);
  543.       if (context == null && debug > 0) {
  544.          System.err.println("# Warning: applet context not found for contextID " + contextID);
  545.       }
  546.  
  547.       return context;
  548.    }
  549.  
  550.    static MozillaAppletContext ensureAppletContext(int contextID) {
  551.       Integer key = new Integer(contextID);
  552.       MozillaAppletContext context = (MozillaAppletContext)appletContexts.get(key);
  553.       if (context == null) {
  554.          context = new MozillaAppletContext(key);
  555.          appletContexts.put(key, context);
  556.       }
  557.  
  558.       return context;
  559.    }
  560.  
  561.    static void initApplet(int parentContext, int frameContext, int contextID, int appletID, String[] argv) {
  562.       Hashtable params = new Hashtable();
  563.  
  564.       for(int i = 1; i < argv.length; ++i) {
  565.          String str = argv[i];
  566.          int j = str.indexOf(61);
  567.          if (j >= 0) {
  568.             params.put(str.substring(0, j).toLowerCase(), str.substring(j + 1));
  569.          }
  570.       }
  571.  
  572.       String dbg = (String)params.get("debug");
  573.       if (dbg != null) {
  574.          try {
  575.             debug = Integer.parseInt(dbg);
  576.          } catch (Exception var9) {
  577.          }
  578.       }
  579.  
  580.       if (debug > 0) {
  581.          System.err.println("# initApplet: contextID=" + contextID + " appletID=" + appletID + " parentContext=" + parentContext + " frameContext=" + frameContext);
  582.       }
  583.  
  584.       trimApplets();
  585.       MozillaAppletContext acx = ensureAppletContext(contextID);
  586.       acx.frameMWContext = frameContext;
  587.       acx.initApplet(appletID, argv[0], params);
  588.    }
  589.  
  590.    static void startApplet(int contextID, int appletID, int newFrameMWContext) {
  591.       if (debug > 0) {
  592.          System.err.println("# startApplet: contextID=" + contextID + " appletID=" + appletID + " newFrameMWContext=" + newFrameMWContext);
  593.       }
  594.  
  595.       MozillaAppletContext acx = getAppletContext(contextID);
  596.       if (acx != null) {
  597.          acx.frameMWContext = newFrameMWContext;
  598.          acx.startApplet(appletID);
  599.       }
  600.    }
  601.  
  602.    static void stopApplet(int contextID, int appletID) {
  603.       if (debug > 0) {
  604.          System.err.println("# stopApplet: contextID=" + contextID + " appletID=" + appletID);
  605.       }
  606.  
  607.       MozillaAppletContext acx = getAppletContext(contextID);
  608.       if (acx != null) {
  609.          acx.frameMWContext = 0;
  610.          acx.stopApplet(appletID);
  611.          trimApplets();
  612.       }
  613.    }
  614.  
  615.    static void destroyApplet(int contextID, int appletID) {
  616.       if (debug > 0) {
  617.          System.err.println("# destroyApplet: contextID=" + contextID + " appletID=" + appletID);
  618.       }
  619.  
  620.       MozillaAppletContext acx = getAppletContext(contextID);
  621.       if (acx != null) {
  622.          acx.destroyApplet(new Integer(appletID));
  623.          if (acx.appletFrames.isEmpty()) {
  624.             if (debug > 0) {
  625.                System.err.println("#   destroyApplet: destroying context for contextID " + contextID);
  626.             }
  627.  
  628.             acx.destroy();
  629.          }
  630.  
  631.       }
  632.    }
  633.  
  634.    static Object reflectApplet(int contextID, int appletID) {
  635.       if (debug > 0) {
  636.          System.err.println("# reflectApplet: contextID=" + contextID + " appletID=" + appletID);
  637.       }
  638.  
  639.       MozillaAppletContext acx = getAppletContext(contextID);
  640.       return acx == null ? null : acx.reflectApplet(appletID);
  641.    }
  642.  
  643.    static void iconifyApplets(int contextID) {
  644.       if (debug > 0) {
  645.          System.err.println("# iconifyApplets: contextID=" + contextID);
  646.       }
  647.  
  648.       MozillaAppletContext acx = getAppletContext(contextID);
  649.       if (acx != null) {
  650.          acx.iconifyApplets();
  651.       }
  652.    }
  653.  
  654.    static void uniconifyApplets(int contextID) {
  655.       if (debug > 0) {
  656.          System.err.println("# uniconifyApplets: contextID=" + contextID);
  657.       }
  658.  
  659.       MozillaAppletContext acx = getAppletContext(contextID);
  660.       if (acx != null) {
  661.          acx.uniconifyApplets();
  662.       }
  663.    }
  664.  
  665.    static void destroyApplets(int contextID) {
  666.       if (debug > 0) {
  667.          System.err.println("# destroyApplets: contextID=" + contextID);
  668.       }
  669.  
  670.       MozillaAppletContext acx = getAppletContext(contextID);
  671.       if (acx != null) {
  672.          acx.destroy();
  673.       }
  674.    }
  675.  
  676.    static void destroyAll() {
  677.       if (debug > 0) {
  678.          System.err.println("# destroyAll");
  679.       }
  680.  
  681.       int size = appletContexts.size();
  682.  
  683.       for(int i = size - 1; i >= 0; --i) {
  684.          MozillaAppletContext acx = (MozillaAppletContext)appletContexts.elementAt(i);
  685.          acx.destroy();
  686.       }
  687.  
  688.    }
  689.  
  690.    static void dumpState(PrintStream out) {
  691.       int size = appletContexts.size();
  692.  
  693.       for(int i = 0; i < size; ++i) {
  694.          MozillaAppletContext acx = (MozillaAppletContext)appletContexts.elementAt(i);
  695.          acx.dumpState(out, 0);
  696.       }
  697.  
  698.    }
  699. }
  700.