2013/12/27 Bertrand Delacretaz <[email protected]> > Hi Carsten and Georg, > > I was going to say that I still disagree, but being outnumbered I'd > let it go if it's just about a single method that I don't like...and > then I reviewed the org.apache.sling.hc.api package once again and > it's worse than I thought. > The problem is really, if we don't have a method with this signature how can the jmx implementation make use of the executor while the executor is still able to cache the result, do async processing etc. ? I don't see any other solution atm, apart from moving the jmx implementation into the core.
> > You guys both say you don't want metadata in APIs...and the > HealthCheckResult interface that you added has these two methods > (which make sense BTW): > > String getHealthCheckName(); > List<String> getHealthCheckTags(); > > So a HC is not brave enough to have this in its API, but a Result > needs them? This clearly demonstrates that we need a > HealthCheckMetadata interface that provides those values. > > I think these are different concerns, a service(!) does not need an api to expose the metadata because it's already in the service registration. When we return a set of results, there need to be way of correlation between a single result and an actual check, otherwise you get a bunch of results without any additional information about the check. The way out of this, would be to just have a single method execute(ServiceReference) in the executor :) - but as soon as we allow execution of more than a single HC we need this additional information. > On top of that, the Result throws UnsupportedException on these > methods...how ugly is that, why can't it provide these values from the > HealthCheck that was used to create it? > I haven't looked deeply at this part yet... > > To me this smells of implementation-driven APIs, we are used to better > design in Sling. > > As pointed out, I'm all ears for a better solution of the executor interface that allows us to get the above mentioned features. And as pointed out below, if we simplify the executor service to a single method, we don't need to make any changes to Result or add any additional information. Carsten What do others think? > > -Bertrand > > [1] > > > https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/api > -- Carsten Ziegeler [email protected]
