incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1558780 - /sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java
Date Thu, 16 Jan 2014 13:11:54 GMT
Author: bdelacretaz
Date: Thu Jan 16 13:11:54 2014
New Revision: 1558780

URL: http://svn.apache.org/r1558780
Log:
SLING-3278 - make SlowHealthCheckSample immediate to have a (somewhat) persistent counter

Modified:
    sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java

Modified: sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java?rev=1558780&r1=1558779&r2=1558780&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java
Thu Jan 16 13:11:54 2014
@@ -38,10 +38,17 @@ import org.slf4j.LoggerFactory;
 /** Sample Health Check that takes N msec to execute,
  *  used to demonstrate execution timeouts and caching.
  */
+
+// Need to make the component immediate to make sure a single 
+// instance is used, otherwise the lazy DS activation policy
+// might cause a different instance to be used for every
+// execution. In this sample this is just done to allow the
+// counter to persist as long as this service's bundle is active.
 @Component(
         configurationFactory=true,
         policy=ConfigurationPolicy.REQUIRE,
-        metatype=true)
+        metatype=true,
+        immediate=true)
 @Properties({
     @Property(name=HealthCheck.NAME),
     @Property(name=HealthCheck.TAGS, unbounded=PropertyUnbounded.ARRAY),



Mime
View raw message