Whenever Java classes are referenced from Runtime contributions, specific error management is needed to highlight the problem (class not found, not following expected interface).
Custom code is also needed to instantiate the class even if expected constructor does not need arguments most of the time, and related error management is needed too.
-> handle this consistently at the xmap and registry level to avoid custom code in most of cases.
Uses cases to keep in mind:
- the given class reference could be empty (to handle disablement of a contribution without re-stating the class, or to handle cases where the class is optional)
- the class might extend a specific interface (show a nice error message when the given class does not implement the interface)
- the error should state the target extension point to (as there might be several points with the same name in the same file, just not the same target...), see sample here:
2021-01-28T09:22:19,283 WARN [http-nio-0.0.0.0-8080-exec-6] [org.nuxeo.common.xmap.registry.MapRegistry] The contribution with id 'default' on extension 'default-repository-config#configuration' has been implicitly merged: the compatibility mechanism on its descriptor class 'org.nuxeo.runtime.kv.KeyValueStoreDescriptor' detected it, and the attribute merge="true" should be added to this definition.
+ maybe handle these as runtime errors in a PR to detect such use cases by default
- is related to
-
NXP-30178 Make default xmap registries runtime-aware
- Resolved