Serialization Deserialization of Endpoints and EndpointReferencesA sample scenario
Assuming we have two nodes (Node1, Node2) within an SCA domain. Node1 runs component1 which is wired to component2 on Node2.
public class Component1Impl { @Reference ServiceReference<Component3> component3; @Reference Component2 component2; public String op1(...) { // Pass a ServiceReference of component3 to component2 component2.op2(component3, ...); } } public class Component2Impl { public String op2(ServiceReference<Component3> component3Ref, ...) { ... // Call component3 using the service reference Component3 component3 = component3Ref.getService(); component3.op3(...); } } What information should be serialized?Endpoint serializationWhat information is needed on the consumer side?
What information is not needed on the consumer side?
I'm not sure if the componentType of the owning component or interface contracts are needed. Interface validation against a remote endpoint can be one only if the interface contract for the endpoint is resolvable in the context of the consuming component. But it can be too restrictive as it breaks the promise of decoupling between the SCA reference and service. The current code serializes the endpoint as a composite/component/service/binding XML. <composite name="..." targetNamespace> <component name="..." uri="..."> <implementation.bpel process="..."/> <!-- This should be removed --> <service name="..." requires="..." policySets="..."> <interface.wsdl interface="..."/> <!-- Is the interface needed? --> <binding.ws uri="..." requires="..." policySets="..."/> </service> </component> </composite> How to resolve the deserialized endpoint in the context of the consuming component?We keep the XML document from the Java serialization and load the XML into a composite model to rebuild the endpoint in the context of the consuming component. The currect scheme of XML serialization probably contains too much information and some of them cannot be practically resolvable on the client side. For example, the target component implementation or interface contracts.
EndpointReference serializationWhat information is needed on the consumer side?
What information is not needed on the consumer side?
I'm not sure if the componentType of the owning component or interface contracts are needed. Interface validation against a remote endpoint can be one only if the interface contract for the endpoint is resolvable in the context of the consuming component. But it can be too restrictive as it breaks the promise of decoupling between the SCA reference and service. The current code serializes the endpoint reference as a composite/component/reference/binding XML. <composite name="endpointReference" targetNamespace="..."> <component name="..." uri="..."> <implementation.java class="..."/> <!-- This should be removed --> <reference name="..." requires="..." policySets="..." target="..."> <!-- reference/@target and binding.ws/@uri are exclusive --> <interface.java interface="..."/> <!-- Is the interface needed? --> <binding.ws uri="..." requires="..." policySets="..."/> </reference> </component> </composite> How to resolve the deserialized endpoint reference in the context of the consuming component?We keep the XML document from the Java serialization and load the XML into a composite model to rebuild the endpoint in the context of the consuming component. The currect scheme of XML serialization probably contains too much information and some of them cannot be practically resolvable on the client side. For example, the target component implementation or interface contracts.
|