/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/web/StatusListener.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/web/StatusListener.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1674 by torben, Fri Dec 23 09:16:12 2011 UTC revision 1675 by torben, Wed Dec 28 13:20:43 2011 UTC
# Line 48  public class StatusListener extends ApiL Line 48  public class StatusListener extends ApiL
48                  }                  }
49    
50                  String xml;                  String xml;
51                  long now = System.currentTimeMillis();  
52                  if ( (now-cachedTime) > 5000) {                  synchronized(this) { //is this necessary ?
53                          xml = buildXML();                          long now = System.currentTimeMillis();
54                          cachedXml = xml;                          if ( (now-cachedTime) > 5000) {
55                          cachedTime = now;                                  xml = buildXML();
56                  } else {                                  cachedXml = xml;
57                          xml = cachedXml;                                  cachedTime = now;
58                  }                                } else {
59                                    xml = cachedXml;
60                            }
61                    }
62                                                    
63    
64                  event.setResponse(xml);                  event.setResponse(xml);

Legend:
Removed from v.1674  
changed lines
  Added in v.1675

  ViewVC Help
Powered by ViewVC 1.1.20