Hi,
I have pushed my changes. It is pretty simple from the user point of view:
defaultSchemaManager.setErrorHandler(schemaErrorHandler);
I have removed old List<Throwable> errors and replaced it with
SchemaErrorHandler interface. I have figured that it is actually OK to
pay a cost of indirection here. It will only impact the servers with bad
schema, and those servers deserve to suffer anyway, right? :-) The real
reason was that by always using SchemaErrorHandler (and providing
default logging implemenation) I was able to somehow simplify and unify
error handling.
However, I have encountered two issues:
1) There are two dissociateFromSchema() methods in Registries. One of
them is used, the other seems not to be used at all. The difference was
in the parameters. When I removed the "errors" parameter then those
method clashed. They seem to do quite different things, so they probably
should not have the same name anyway (if both are really used). So I
have renamed the wrong one to dissociateFromSchemaQuestionable().
Emmanual, this is probably something you should have a look at. I feel a
bit lost here.
2) Ava. I think Ava is supposed to be a simple object, almost like a
DTO. It is a bit tangled with SchemaManager ... but I haven't found any
good way how to implement flexible logging in Ava (I do not want to
pollute SchemaManager interface with SchemaErrorHandler). But I have
realized that Ava is such a simple object, it probably should not log
the errors at all. It is throwing exceptions anyway. So I think it would
be responsibility of the caller to log errors (exceptions). So I have
removed the logging statements from Ava constructors. I hope that this
is OK. I have also found potential issues with Ava
comparison/normalization .... I have put a comment in the source code.
This is probably something to have a look in the future.
Overall, the solution is not perfect. But I'm quite happy with that for
2.0. It is definitely better than the temporary hack that we had in 1.0.
--
Radovan Semancik
Software Architect
evolveum.com