Hi Rajini,

Thanks for your answer. It improved my understanding of SCA scopes in OSGi 
services.
The last part (using osgi bundles but not osgi services) works fine, I just 
wanted to experiment with osgi Declarative Services.

I added servicefactory="true" to my osgi service description. It still also 
contained immediate="true", which seems to be opposed.
With these settings my test ran into an infinite loop in method 
getOSGiServiceReference(Interface serviceInterface, String filter, String 
scaServiceName) of class OSGiImplementationProvider. The while loop never 
completes, as osgiServiceReference is always null.

So I set immediate="true". Now I have the same behavior as described in my 
previous mail. So servicefactory="true" seems to have no effect.

As I understood your comments, there is no need to implement a Factory class 
when using Declarative Services, right ?
This is my component description file:

<?xml version="1.0" encoding="UTF-8"?>
<component name="GammaDS" immediate="false">
    <implementation class="services.GammaImpl" />
    <service servicefactory="true">
         <provide interface="services.Gamma"/>
    </service>
    <property name="org.eclipse.test.type" value="test1"/>
</component>

Any ideas what's the issue here ?
Thanks in advance.

Bye,
Daniel
 

> -----Ursprüngliche Nachricht-----
> Von: Rajini Sivaram [mailto:[EMAIL PROTECTED] 
> Gesendet: Sonntag, 6. April 2008 22:02
> An: tuscany-user@ws.apache.org
> Betreff: Re: Question about Conversational OSGi Services and 
> Service References
> 
> Daniel,
> 
> The default scope for implementation.osgi components is 
> COMPOSITE - this matches standard OSGi services where a 
> single instance of the service is added to the OSGi service 
> registry and the same instance is returned by any OSGi 
> registry lookup. Other SCA scopes including CONVERSATION are 
> supported by implementation.osgi, but they require the OSGi 
> service to be implemented using service factories. If a 
> service factory is registered for Gamma, Tuscany will force a 
> new instance of Gamma to be created for every new 
> conversation. There is an example of conversational services 
> using OSGi procedural services under 
> itest/osgi-implementation. It is much simpler with 
> declarative services since you would just need to specify the 
> servicefactory flag for the service.
> 
> If you want to use a conversational service with Tuscany 
> without registering the service in the OSGi registry, you can 
> use implementation.java. Since your contribution is a bundle, 
> OSGi will still be used to resolve your classes, but the 
> conversational service instances can be created directly 
> without going through OSGi service factories.
> 
> Hope this helps.
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to