[ https://issues.apache.org/jira/browse/SLING-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13852731#comment-13852731 ]
Georg Henzler commented on SLING-3278: -------------------------------------- 1) maybe we should rather go run(String fullyQualifiedClassname) then - although getting the service is easy it's also easy to get it wrong. And it's just a waste to get the service if you don't need to (the executor does not get the service if there is a cache hit, there is async results or a future is running already) 2) I agree we should get of the method setHealthCheckDescriptor(), but adding as constructor element is not an easy option (the health check itself is constructing it, but it is set by the executor later). If we add it as a constructor parameter we need a clone constructor Result(resultFromCheckItself, hcDescriptor, finishedDate, elapsedTime). Or we put the class result behind an implementation class (that would be a nicer option IMHO), the problem with that is that new Result(...) is used directly in the checks and is part of the current API => the clone constructor is probably still the better solution 3) The descriptor contains currently the hc name and the tags - this meta information is useful in the UI (it is shown in the web console). Before my patch the service reference was used directly in the web console (using a lot more code, e.g. dealing with the fact that the OSGi array props do appear as simple string if only one element is contained). Now IMHO it is cleanly separated and the HC meta information is available to the UI (without being tied to the OSGi API, also see your first point ;-)). Another option would be to copy name and tags as plain properties to the Result, but IMHO it is cleaner and more extensible to leave the constant meta data (not changing for multiple hc executions) in a separate class (also it is a really useful key class for the executor, if we got rid of it in the API we should at least leave it in the impl.executor package) > Provide a HealthCheckExecutor service > ------------------------------------- > > Key: SLING-3278 > URL: https://issues.apache.org/jira/browse/SLING-3278 > Project: Sling > Issue Type: New Feature > Components: Health Check > Reporter: Georg Henzler > Assignee: Georg Henzler > Attachments: SLING-3278-bertrand.patch, > SLING-3278-hc.core-HealthCheckExecutorService-2013-12-19.patch, > SLING-3278-hc.webconsole-2013-12-19.patch, hc-it.patch > > > Goals: > * Be able to get an overall (aggregated) result as quickly as possible > (ideally <2sec) > * Whenever possible, return most current results (e.g. for a memory check) > * Provide a declarative way for async checks (async checks should be the > exception though) > Approach > * Run checks in parallel > * Make sure long running (or even stuck) checks are timed out > * If a health check must run asynchronously (because its execution time > cannot be optimized), it should be enough to just specify a service property > (e.g. "hc.async"). > See also > http://apache-sling.73963.n3.nabble.com/Health-Check-Improvements-td4029330.html#a4029402 > http://apache-sling.73963.n3.nabble.com/Health-checks-execution-service-td4028477.html -- This message was sent by Atlassian JIRA (v6.1.4#6159)