...snip > > 1. Check if an endpoint is a suitable target for a given endpoint reference > a) Check the compatibility of interface contracts > * InterfaceContractMapper > b) Check the compatibility of policy configurations (intents and > policySets) > * PolicyBuilder? (I'm trying to come up some SPIs here) > > 2. Find the local target endpoint during build phase > * EndpointReferenceBuilderImpl > a) via @target (look up an endpoint in the same composite that matches the > structural URI) > b) via autowiring (look up an endpoint in the same composite that is > compatible) > > NOTE: the current implementation looks up the target component/service and > create endpoints out of them. I think we should match against the existing > endpoints and (we set the matching endpoint as the "targetEndpoint" > attribute of endpoint reference).
Agreed, and in this case we could do the policy matching at this point. There used to be a method set up ready to do that but it disappeared at some stage. Doing policy matching on local endpoints at build time rather than waiting until runtime is advantageous because it identifies any errors early on the the deployment process. Of course, in the case where no matching endpoint is found locally for the target name we can't do matching until runtime. > > 3. Bind an endpoint reference to an endpoint in the EndpointRegistry (if the > endpoint reference uses an SCA URI) We only need to do this if the endpoint has not been located at build time. > * EndpointReferenceBinder > * There is no binding configured on the reference (get the binding > configuration from the endpoint) > * There is a binding configured on the reference I note that I don't think the matching code takes account of this at the moment and always assumes that the binding is taken from the matching endpoint > > NOTE: 2 and 3 will follow the same criteria to find the matching endpoint(s) > for a given endpoint reference. > > 4. Create an endpoint reference from the endpoint (ComponentContextImpl) > * Lookup a service proxy (or ServiceReference) from the Node API > * Create a service proxy for SCA client API Not sure I understand what you are saying in point 4. Simon
