The Sling Health Check Runtime is deprecated and superseded by Felix Health Checks. See Sling Health Check Tools (deprecated) for documentation prior to deprecation and Sling Health Checks for checks implemented against the Felix Health Checks Runtime.
<dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.healthcheck.api</artifactId> <version>2.0.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.felix</groupId> <artifactId>org.apache.felix.healthcheck.annotation</artifactId> <version>2.0.0</version> <scope>provided</scope> </dependency>
Typically necessary steps:
Organize Importsfunctionality of your IDE to fix the imports (mostly it is just replacing
org.apache.felix.hc.api, however the commonly used class
FormattingResultLoghas been moved from
@SlingHealthCheckis used, replace that one with the new Felix annotations from org.apache.felix.healthcheck.annotation
utilpackage in the api bundle anymore, apart from
FormattingResultLogthe other classes in the package were rarely used. The class
SimpleConstraintCheckerhas moved to
generalchecks(maven dependency to
org.apache.felix.healthcheck.generalchecksneeds to be added for that case). For the other classes there is no replacement.
Only necessary if the the respective feature is used:
hc.warningsStickForMinutes, this has been renamed to
hc.keepNonOkResultsStickyForSec- here the unit has changed from min to sec in order to allow for second-magnitude values that can be useful for deployment scenarios
hc.async.cronExpressionis used, the bundle
org.apache.servicemix.bundles.quartzmay be added to use quartz for cron expressions (in the same way as it was the case for the Sling Health Checks). If the bundle is not present, a simple cron trigger implementation included in
org.apache.felix.healthcheck.corewill be used instead, see FELIX-6265 for details.
org.apache.sling.hc.api- keep to ensure bundles with checks that are not yet migrated work (can be removed once all bundles are migrated to new API)
org.apache.sling.hc.support- keep, Sling specific health checks that don't fit anywhere else go there
org.apache.felix.healthcheck.core- add (also runs checks implemented against
org.apache.felix.healthcheck.generalchecks- add (optional but recommended)