Currently in CompositeWireBuilderImpl.connectComponentReference all targets
are converted to bindings on a reference and the targets are
removed. During this process the source and target bindings are compared
until matching wireable bindings are found.

Currently only the sca binding implements WireableBinding. I've opened
https://issues.apache.org/jira/browse/TUSCANY-1534 about this.

If the domain is distributed then at the build stage some of the targets
will remain unresolved. For the new sca binding I have made the assumption
here that unresolved targets take a copy of the bindings they may be
resolved against at a later date and that the targets are maintained on the
reference after the build stage. I still assume that the SCA binding is the
only valid wireable binding at present.

So I'm proposing that

1. The builder should retain the list of unresolved targets for use after
the build stage
2. The list of bindings that might be used to resolve a target at a later
date are associated with each target

Come wire creation time care must be take to create remote wires for
unresolved targets. What I do at the moment is:

CompositeActivatorImpl.addReferenceBindingProviders
       As before, create  providers for all bindings that represent resolved
targets

       For all unresolved targets
            If support is enabled create a cloned SCA binding and add it to
the reference binding list (so that a wire will be created).
                This is pretty much what goes on in the CompositeWireBuilder
but I've delayed it until here in the expectation that we will do remote
binding matching one wireable support is fixed
            Create an SCA binding provider which will look up the remote
endpoint at start() time.

Thoughts?

Regards

Simon

Reply via email to