The assmebly diagram
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample" xmlns:sample="http://sample" name="Composite1"> <component name="ComponentA"> <implementation.java class="sample.ComponentAImpl"/> </component> <component name="ComponentB"> <!-- Implemented by Composite3 --> <implementation.composite name="sample:Composite3"/> <!-- Wired to ComponentA --> <reference name="Reference1" target="ComponentA"/> <property name="Property1">ABC</property> </component> <!-- ComponentB.Service1 is promoted --> <service name="Service1" promote="ComponentB/Service1" /> </composite> |
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample" xmlns:sample="http://sample" name="Composite2"> <component name="ComponentC"> <implementation.java class="sample.ComponentAImpl" /> <!-- Wired to ComponentD.Service1 --> <reference name="Reference1" target="ComponentD/Service1" /> </component> <component name="ComponentD"> <!-- Implemented by Composite3 --> <implementation.composite name="sample:Composite3" /> <!-- The property value is "XYZ" --> <property name="Property1">XYZ</property> </component> <!-- ComponentD.Reference1 is promoted --> <reference name="Reference1" promote="ComponentD/Reference1" /> </composite> |
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample" xmlns:sample="http://sample" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Composite3"> <component name="ComponentE"> <implementation.java class="sample.ComponentEImpl" /> <reference name="Reference1" target="ComponentF/Service1" /> <!-- The property is from the composite Property1 --> <property name="Property1" source="$Property1" /> </component> <component name="ComponentF"> <implementation.java class="sample.ComponentFImpl" /> </component> <service name="Service1" promote="ComponentE/Service1" /> <reference name="Reference1" promote="ComponentF/Reference1"> <binding.sca /> </reference> <property name="Property1" type="xsd:string">123</property> </composite> |
1) Two components are implemented by the same composite
Path a: Composite1.ComponentB is implemented by Composite3
Path b: Composite2.ComponentD is implemented by Composite3
The service/reference can be promoted to different things:
a: the final target for the ComponentF.Reference1 is Composite1.ComponentA
b: the final target for the ComponentF.Reference1 is Composite1.Reference1 (pointing to an external service)
The property can be set to different value following different composition path:
a: Composite3.ComponentE.Property1 is overrided by Composite1.ComponentB.Property1 (say value="ABC")
b: Composite3.ComponentE.Property1 is overrided by Composite2.ComponentD.Property1 (say value="XYZ")
To represent the fully-configured components, we need to clone the model for Composite3 for Path a and b so that it can be used to hold different resolved values.
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Hi, I'm trying to indentify all the paths of SCA component interactions which By the SCA spec, there are three cases for the wiring: 1) Component.Reference (A.ref1) -is wired to-> Component.Service (B.svc1) 1.2) If the service is defined on a composite component, then it can be For example, A.ref1 --> B.svc1 (B is implemented by another composite and 1.3) If the reference is defined on a composite component, then it can be For example, A.ref1 --> B.svc1 (A is implemented by another composite and 2) Composite.Reference (Composite1.ref1) -promotes-> Component.Reference If Composite1 is used to implement a component A in Composite2, then we need If B is a composite component, then we need to find out the final component 3) Composite.Service (Composite1.svc1) -promotes-> Component.Service The target will be the innermost service on the promotion chain. For
Based on the above scenarios, it seems that we can create runtime wires 1) Runtime wire for references: For each of the references (r1) on 2) Runtime wire for service promotions: For each of the service1 (s1) on The service/reference promotions make the picture complicated. I hope my Thanks, |
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
public interface RuntimeContext<M> extends Lifecycle { /** * Create an intercetor for the model in the invocation chain. For a reference binding, * the interceptor is responsible to make the outbound invocation over the binding protocol. * For a service binding, the interceptor is responsible to dispatch the incoming call to * the target component service that the service promotes. For a component implementation, * the interceptor will be responsible for calling the implementation logic for the given * component. * * @param model The service that defines the binding * @param operation The operation that the interceptor will handle * @param isCallback A flag to tell if the operation is for the callback * @return An interceptor that handles the invocation logic, null should be returned if no * interceptor is required */ Interceptor createInterceptor(M model, Operation operation, boolean isCallback); /** * Get the effective interface contract imposed by the binding or implementation. For * example, it will be interface contract introspected from the WSDL portType used by the * endpoint for a WebService binding. * @param model The model object * * @return The effective interface contract */ InterfaceContract getEffectiveInterfaceContract(M model); } public interface ReferenceBindingContext extends RuntimeContext<Reference> { /** * @param wire */ void setRuntimeWire(RuntimeWire wire); /** * @return */ RuntimeWire getWire(); } public interface ServiceBindingContext extends RuntimeContext<Service> { /** * @param wire */ void setRuntimeWire(RuntimeWire wire); /** * @return */ RuntimeWire getWire(); } public interface ImplementationContext extends RuntimeContext<Component> { } |