Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Java-SCA-2.0
-
None
-
None
-
None
-
Patch Available
Description
A Tuscany embedder may need to change certain system definitions, e.g. a bindingType or an implementationType.
System definitions are found using the ServiceDiscovery mechanism. DefaultDefinitionsExtensionPoint looks for jars/bundles that have a META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions file.
definitionsDeclarations = registry.getServiceDiscovery().getServiceDeclarations(DEFINITIONS_FILE);
This collects all definitions documents in the runtime. There is no way to override one definitions document with another.
I am attaching a patch to address this. It changes the getServiceDeclarations() call to get declarations in ranked order. When processing the returned declarations, it now processes only the first resource with a given path.
The embedder's service declaration must use the same resource name as the Tuscany definition it replaces and it must have a higher ranking attribute.