On Tue, Jun 10, 2008 at 1:19 PM, Simon Laws <[EMAIL PROTECTED]>
wrote:
>
>
> On Tue, Jun 10, 2008 at 12:01 PM, Simon Laws <[EMAIL PROTECTED]>
> wrote:
>
>> I'm looking at TUSCANY-2352 (which I raised when I was doing some policy
>> testing). The issue is that promoted service bindings aren't augmented with
>> the composite service bindings that promote them. Looking at the
>> BaseWireBuilderImpl code there is a method called
>> reconcileReferenceBindings() that does this job for references. There
>> doesn't appear to be the equivalent for services though. I'm going to go
>> ahead and add something like a reconcileServiceBindings() method unless
>> someone can point me at the code that already tries to do this or explain
>> why we apparently only do this on the reference side?
>>
>> Regards
>>
>> Simon
>>
>
> I have found the method
> BaseConfigurationBuilderImpl.configureNestedCompositeServices() that is
> taking the composite service bindings and creating a new "promoted" service
> in the promoted component to hold them. This doesn't get called until after
> references and services have been matched though which is too late for the
> EndpointBuilder to use the composite service bindings for reference/service
> matching. The order of calls in the top level CompositeBuilder is;
>
> // Collect and fuse includes
> compositeIncludeBuilder.build(composite);
>
> // Expand nested composites
> compositeCloneBuilder.build(composite);
>
> // Configure all components
> componentConfigurationBuilder.build(composite);
>
> // Wire the components
> componentWireBuilder.build(composite);
>
> // Configure composite services
> compositeServiceConfigurationBuilder.build(composite);
>
> // Wire the composite references
> compositeReferenceWireBuilder.build(composite);
>
> The service binding resolution happens in
> compositeServiceConfigurationBuilder.build(composite); So slightly different
> question. Anyone know why compositeServiceConfigurationBuilder comes after
> componentWireBuilder?
>
> Simon
>
I have a fix for this that gets a clean build but I'd like a bit of feedback
before I commit. Here's what the change involves
Change the order of the build processing as follows:
// Collect and fuse includes
compositeIncludeBuilder.build(composite);
// Expand nested composites
compositeCloneBuilder.build(composite);
// Configure all components
componentConfigurationBuilder.build(composite);
// Compute the polices across the composite/component hierarchy
compositePolicyBuilder.build(composite);
// Configure composite services
compositeServiceConfigurationBuilder.build(composite);
// Wire the components
componentWireBuilder.build(composite);
// Wire the composite references
compositeReferenceWireBuilder.build(composite);
I split out the policy processing as part of a previous change so that the
part that connects composite services/references to promoted
services/references and then computes polices can be run independently. To
take account of this I removed the processing that is now done by
compositePolicyBuilder.build(composite); from
componentWireBuilder.build(composite);.
With these changes in place I moved
compositeServiceConfigurationBuilder.build(composite); to happen before the
wiring stage.
The final change I made was to ensure that, during wiring, when services are
indexed for internal processing the algorithm disregards services whose
names start with $promoted$ as these are now present before wiring starts.
There are two impacts to this change that I want to highlight;
1 - $promoted$ services are present during wiring
2- The build process will take a little longer as the references/services
are indexed twice.
I'm still asking here if anyone knows why the composite service building
phase was placed after wiring. Now I've looked into it in some detail I can
guess but would be useful to know what the original thinking was.
Regards
Simon