When processing references at the domain level I need to know the name of
the target service which each reference binding is associated with so that I
can match the binding with the service name when the service endpoint is
made available or is moved or removed.  As a work around I set the binding
name to the target service name in the case that target services cannot be
resolved locally. Not ideal!  .

I would like to propose that we add this information into the base binding
model. For example,

public interface Binding extends Base {

    Service getTargetService();
    void setTargetService(Service service);

The other thing that this could help us sort out is the OptimizableBinding.
This holds target service information. With the changes made to take the
majority of the domain logic out of the SCA binding I could get away with
just knowing the target service.

We do still have to be able to clone bindings (another feature of
OptimizableBinding) in the case where there is more than one target. If I
understand it correctly the assembly model follows what you see in composite
XML, For example,

    <component name="SomeComponent">
        <implementation.java class="my.ComponentImpl"/>
        <reference name="ref" target="TargetService1 TargetService2">
           <binding.ws/>
           <binding.jsonrpc/>
        </reference>
    </component>

Leads to a model that looks something like

  Component
     Reference
         Targets
             TargetService1
             TargetService2
         Bindings
              binding.ws
              binding.jsonrpc

With the obvious fun involved in working out which binding is associated
with which target. If they both want to use the same binding it has to be
cloned. Have I got this right? If so should we make bindings generally
cloneable?

Simon

Reply via email to