You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2007/05/04 07:40:18 UTC

InterfaceContract is not correctly set for a component service if the component is implemented by a composite

Hi,

I ran into an issue with the following assembly:

ComponentA is implemented by Composite1. Composite1 defines a 
CompositeService Service1 which promotes ComponentB.Service1. Only 
Component.Service1 has a java interface defined.

>From the debugger, I observed that the CompositeUtil resolves the 
InterfaceContract in the sequence below:

1) 
ComponentA.Service1.setInterfaceContract(Composite1.Service1.getInterfaceContract()); 
// At this moment, it's null
2) 
Composite1.Service1.setInterfaceContract(ComponentB.Service1.getInterfaceContract()); 
// This is good for Composite1.Service1 but it doesn't pop up to 
ComponentA.Service1

As a result, ComponentA.Service1 still has a null InterfaceContract.

Thanks,
Raymond


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: InterfaceContract is not correctly set for a component service if the component is implemented by a composite

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Raymond Feng wrote:
> Hi,
>
> I ran into an issue with the following assembly:
>
> ComponentA is implemented by Composite1. Composite1 defines a 
> CompositeService Service1 which promotes ComponentB.Service1. Only 
> Component.Service1 has a java interface defined.
>
>> From the debugger, I observed that the CompositeUtil resolves the 
> InterfaceContract in the sequence below:
>
> 1) 
> ComponentA.Service1.setInterfaceContract(Composite1.Service1.getInterfaceContract()); 
> // At this moment, it's null
> 2) 
> Composite1.Service1.setInterfaceContract(ComponentB.Service1.getInterfaceContract()); 
> // This is good for Composite1.Service1 but it doesn't pop up to 
> ComponentA.Service1
>
> As a result, ComponentA.Service1 still has a null InterfaceContract.
>
> Thanks,
> Raymond
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

If I understand correctly, we have reconcile interfaces in 2 phases:
a) reconcile the interface of a a component service and the interface of 
the corresponding service on the component's componentType.
b) reconcile the interface of a composite service and the interface of 
the promoted component service

Switching the order of execution of these 2 phases should fix the 
problem you're seeing, I can take a look and try that if it helps.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org