From: <jbo...@li...> - 2006-01-26 18:37:51
|
Author: wrzep Date: 2006-01-26 13:37:43 -0500 (Thu, 26 Jan 2006) New Revision: 2211 Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java Log: Forced update every 10 "nodeUpdate" calls to ensure we've got up to date statistics. http://jira.jboss.com/jira/browse/JBLAB-595 Pawel Modified: trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java 2006-01-26 18:13:06 UTC (rev 2210) +++ trunk/forge/portal-extensions/forge-status/src/java/org/jboss/forge/status/StatusNodeWatcher.java 2006-01-26 18:37:43 UTC (rev 2211) @@ -33,8 +33,11 @@ private ResourceWatcher rw; private ContentManager cm; + private int updateCounter; + public StatusNodeWatcher(ContentManager cm) { this.cm = cm; + updateCounter = 0; } private StatusDescriptor getDesc(String portalName) { @@ -68,10 +71,13 @@ public Object nodeUpdate(String portalName, Object currentValue) { - //TODO update from time to time - if ((currentValue == null) || (rw.checkResources())) + if ((currentValue == null) || (rw.checkResources()) || (updateCounter == 9)) { + + updateCounter = 0; return getDesc(portalName); - else + } else { + ++updateCounter; return null; + } } } |