commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r741101 - /commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java
Date Thu, 05 Feb 2009 13:36:13 GMT
Author: nicolas
Date: Thu Feb  5 13:36:12 2009
New Revision: 741101

URL: http://svn.apache.org/viewvc?rev=741101&view=rev
Log:
configurable startup delay - defautls to period

Modified:
    commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java

Modified: commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java?rev=741101&r1=741100&r2=741101&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java
(original)
+++ commons/sandbox/monitoring/branches/modules/reporting/src/main/java/org/apache/commons/monitoring/reporting/AbstractPeriodicLogger.java
Thu Feb  5 13:36:12 2009
@@ -43,6 +43,9 @@
     /** The interval for periodic logging of monitored state */
     private int period;
 
+    /** The initial delay */
+    private int delay;
+
     /**
      * @param period the period (in ms) to log the monitoring state
      * @param repository the observed repository
@@ -52,6 +55,7 @@
         this();
         this.repository = repository;
         this.period = period;
+        this.delay = period;
     }
 
     public AbstractPeriodicLogger()
@@ -77,7 +81,7 @@
                 Repository observed = observeRepositoryForPeriod();
                 log( observed );
             }
-        }, period, period, TimeUnit.MILLISECONDS );
+        }, delay, period, TimeUnit.MILLISECONDS );
     }
 
     private Repository observeRepositoryForPeriod()
@@ -120,4 +124,9 @@
     {
         this.period = period;
     }
+
+    public void setDelay( int delay )
+    {
+        this.delay = delay;
+    }
 }



Mime
View raw message