/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/web/StatusListener.java |
Parent Directory | Revision Log | Patch
revision 1672 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); |
|
ViewVC Help | |
Powered by ViewVC 1.1.20 |