On 8/9/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote: > > Simon Laws wrote: > > I need some advice on the way the code is structures. In various places > in > > the code I need to get at some information that logically belongs to the > sca > > domain. For example, > > > > CompositeWireBuilderImpl.connectComponentReferences() > > > > Tries to resolve services. In the distributed case this resolution may > > validly fail and I need to ask the domain whether the service is > available > > elsewhere. So I need access to some domain management services. Ideally > I > > would like to have access to a domain interface but am unsure how to > plumb > > it in as this kind of thing isn't generally available now. Anyone care > to > > offer some advice how I get at such an interface without breaking the > SPIs? > > > > Thanks > > > > Simon > > > > > WireCompositeBuilderImpl is not an SPI, so you can pass whatever you > want to its constructor without breaking any SPI. > > But I have a preliminary question: Why do you need to ask the domain > (management service) about remote services at that specific point in > WireCompositeBuilderImpl? > > -- > Jean-Sebastien > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > Hi Sebastien
I was thinking about this on the drive home. Just looking back at the code I had missed the important point that a reference target remains unresolved if the target component cannot be found. I could use this instead of the actual service lookup at this point. The issue I have though is that the CompositeWireBuilder dumps the bindings from the reference if it can't find a matching service/binding. This will be the case if the model for the references service/binding is not read into the model for the current node, i.e. if the target component is not included in the current nodes contributions. Is it valid to only replace the current bindings with "selectedBindings" if some selected bindings have actually be found? Simon
