You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Julien Bigot <ju...@irisa.fr> on 2008/07/09 15:27:10 UTC
[C++ Native] scope="composite"
Hi,
I'm new to SCA and I've tried to implement a first composite with a few inner
components.
These components are written in C++ and use a legacy library that needs each
user to be identified by a unique ID.
I've therefore set the scope of the only interface of my component connected
to this library as "composite" so that it doesn't connect twice with the same
ID.
It seems however that this is not taken into account and that many instances
of the component are build.
Is it a known behaviour or is the problem in my code ?
Thanks,
Julien
Re: [C++ Native] scope="composite"
Posted by Julien Bigot <ju...@irisa.fr>.
Le Jeudi 10 Juillet 2008 à 05:28, haleh mahbod a écrit :
> have you checked the JIRAs to see if a similar problem was reported? I am
> not too familiar with C++, but that maybe a starting point.
I have checked the jIRAs for C++ SCA, but found nothing similar.
After checking the documentation and the implementation again, I think I have
found two problems.
I'd really like your help to see if my understanding of
* In the documentation, it is stated that the "scope" attribute can be defined
for "interface.cpp" nodes while in the implementation, the "scope" attribute
is handled when defined for "implementation.cpp" nodes.
I can see the rationale behind both of these solutions but it seems to me that
the one stated in the documentation is better.
Anyway, if the chosen solution has changed, the documentation should be
updated.
I will open a bug for that.
* In the documentation, it is stated that :
---
> composite – Service requests are delegated to the same C++ class instance
> for _all requests_ within the same “composite”. The lifecycle of a
> composite-scoped instance extends from the point where the composite
> component is loaded in the SCA runtime such that it is ready to service
> requests until the composite is unloaded or stopped. Registry lookups will
> return the same composite-scoped service instance for the duration of the
> composite.
---
The problem here is that "all requests" is not very clear. Does that mean :
- All request to the same service ?
- All request to the same "logical" component instance ?
- All request, really ALL requests, even to a service this component doesn't
implement ?
The actual implementation has the 3rd behaviour which leads to segfaults.
I'd advocate for the 1st or 2nd one depending if the scope is defined on an
interface or on an implementation.
I actually have a patch for this 2nd behaviour, but before taking time to
polish it I'd like to be sure that this is really considered as a bug and that
I am not the one misunderstanding the specification.
> [...]
thanks,
Julien
Re: [C++ Native] scope="composite"
Posted by haleh mahbod <hm...@gmail.com>.
have you checked the JIRAs to see if a similar problem was reported? I am
not too familiar with C++, but that maybe a starting point.
On 7/9/08, Julien Bigot <ju...@irisa.fr> wrote:
>
> Le Mercredi 09 Juillet 2008 à 15:27, Julien Bigot a écrit :
> > Hi,
> >
> > I'm new to SCA and I've tried to implement a first composite with a few
> > inner components.
> > These components are written in C++ and use a legacy library that needs
> > each user to be identified by a unique ID.
> > I've therefore set the scope of the only interface of my component
> > connected to this library as "composite" so that it doesn't connect twice
> > with the same ID.
> > It seems however that this is not taken into account and that many
> > instances of the component are build.
> > Is it a known behaviour or is the problem in my code ?
> >
> > Thanks,
> > Julien
>
> After reading tuscany code it seems there's a difference between the
> documentation as found in
>
> http://www.osoa.org/download/attachments/35/SCA_ClientAndImplementationModelforCpp_V0.95.pdf?version=1
> and the actual implementation and that the scope attribute should go to the
> implementation.cpp node rather than to the interface.cpp as stated in the
> documentation.
>
> Am I using an outdated documentation or doing another mistake ?
>
> Thanks,
> Julien
>
>
Re: [C++ Native] scope="composite"
Posted by Julien Bigot <ju...@irisa.fr>.
Le Mercredi 09 Juillet 2008 à 15:27, Julien Bigot a écrit :
> Hi,
>
> I'm new to SCA and I've tried to implement a first composite with a few
> inner components.
> These components are written in C++ and use a legacy library that needs
> each user to be identified by a unique ID.
> I've therefore set the scope of the only interface of my component
> connected to this library as "composite" so that it doesn't connect twice
> with the same ID.
> It seems however that this is not taken into account and that many
> instances of the component are build.
> Is it a known behaviour or is the problem in my code ?
>
> Thanks,
> Julien
After reading tuscany code it seems there's a difference between the
documentation as found in
http://www.osoa.org/download/attachments/35/SCA_ClientAndImplementationModelforCpp_V0.95.pdf?version=1
and the actual implementation and that the scope attribute should go to the
implementation.cpp node rather than to the interface.cpp as stated in the
documentation.
Am I using an outdated documentation or doing another mistake ?
Thanks,
Julien