Hi,

Playing with my SlowHealthCheckSample [1] I noticed that a new
instance is created for each execution, as a result of
HealthCheckFuture getting and ungetting the service every time.

Is there a way to tell the OSGi framework to create a single instance
of the service and reuse it? I thought this is what would happen in
this case, but it's not, maybe because there are no more users of the
service after HealthCheckFuture calls unget.

Without that it's hard to keep state in the HC - an HC that checks
external systems, for example, will need to be aware of previous
failures.

-Bertrand

[1]  
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck/samples/src/main/java/org/apache/sling/hc/samples/impl/SlowHealthCheckSample.java

Reply via email to