incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1558040 - in /sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc: api/execution/HealthCheckExecutionResult.java core/impl/executor/ExecutionResult.java
Date Tue, 14 Jan 2014 14:11:47 GMT
Author: cziegeler
Date: Tue Jan 14 14:11:47 2014
New Revision: 1558040

URL: http://svn.apache.org/r1558040
Log:
SLING-3278 : Provide a HealthCheckExecutor service. Don't return a date if execution timed
out

Modified:
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutionResult.java
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/ExecutionResult.java

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutionResult.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutionResult.java?rev=1558040&r1=1558039&r2=1558040&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutionResult.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutionResult.java
Tue Jan 14 14:11:47 2014
@@ -24,7 +24,9 @@ public interface HealthCheckExecutionRes
     long getElapsedTimeInMs();
 
     /**
-     * Get the date, the health check finished.
+     * Get the date, the health check finished or if the
+     * execution timed out, <code>null</code> is returned.
+     * @return The finished date of the execution or <code>null</code>
      */
     Date getFinishedAt();
 

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/ExecutionResult.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/ExecutionResult.java?rev=1558040&r1=1558039&r2=1558040&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/ExecutionResult.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/ExecutionResult.java
Tue Jan 14 14:11:47 2014
@@ -37,18 +37,30 @@ public class ExecutionResult implements 
     private final Date finishedAt;
     private final long elapsedTimeInMs;
 
-    /** Build a single-value Result
-     *  @param s if lower than OK, our status is set to OK */
-    ExecutionResult(final HealthCheckMetadata metadata, Result simpleResult,
-            long elapsedTimeInMs) {
+    /**
+     * Full constructor
+     */
+    ExecutionResult(final HealthCheckMetadata metadata,
+            final Result simpleResult,
+            final long elapsedTimeInMs,
+            final Date finishedAt) {
         this.metaData = metadata;
         this.resultFromHC = simpleResult;
-        this.finishedAt = new Date();
+        this.finishedAt = finishedAt;
         this.elapsedTimeInMs = elapsedTimeInMs;
     }
 
     /**
-     * Shortcut constructor to created error result.
+     * Shortcut constructor for a result
+     */
+    ExecutionResult(final HealthCheckMetadata metadata,
+            final Result simpleResult,
+            final long elapsedTimeInMs) {
+        this(metadata, simpleResult, elapsedTimeInMs, new Date());
+    }
+
+    /**
+     * Shortcut constructor to create error result.
      *
      * @param healthCheckDescriptor
      * @param status
@@ -59,7 +71,7 @@ public class ExecutionResult implements 
     }
 
     /**
-     * Shortcut constructor to created error result.
+     * Shortcut constructor to create error/timed out result.
      *
      * @param healthCheckDescriptor
      * @param status



Mime
View raw message