You might want to follow some of the tutorial on OSGi enRoute because it uses 
Declarative Services as one of its cornerstones. Here are some links:

        http://enroute.osgi.org/services/org.osgi.service.component.html 
<http://enroute.osgi.org/services/org.osgi.service.component.html>
        http://enroute.osgi.org/doc/217-ds.html 
<http://enroute.osgi.org/doc/217-ds.html>
        
https://github.com/osgi/osgi.enroute.examples/tree/master/osgi.enroute.examples.component.application
 
<https://github.com/osgi/osgi.enroute.examples/tree/master/osgi.enroute.examples.component.application>
        http://enroute.osgi.org/qs/050-start.html 
<http://enroute.osgi.org/qs/050-start.html>

I would be very interested in hearing your experiences moving to DS. Would love 
to have an [App Note][1] on the OSGi enRoute site about moving away from Spring 
to plain DS.

Hope this helps. Kind regards,

        Peter Kriens

[1]: http://enroute.osgi.org/book/680-appnotes.html 
<http://enroute.osgi.org/book/680-appnotes.html>


> On 16 mei 2016, at 05:52, Chong, Kim Theng <kimtheng.ch...@experian.com> 
> wrote:
> 
> Hi all,
>  
> Previously we were using Spring DM to perform dependencies injections and 
> services declaration, and now we would like to migrate to OSGI declarative 
> services/SCR. May I know is there any ways to perform:
>  
> 1.       bean wiring/dependency injection for SCR like Spring DM does? For 
> example:
>  
> ·         @line1: We want to expose “myService” as a service. (This should be 
> achievable by using @Component, @Service, correct me if I am wrong)
> ·         @line7: We want to inject “serviceRegistry” dependency to 
> “myService”.
> ·         Note: “serviceRegistry” is a normal bean class, which does NOT 
> expose as a service.
>  
> <image002.png>
>  
> 2.       Reading properties from a configuration file and binding them into 
> service? For example
>  
> a.       There is a configuration file: service.config with following 
> properties:
>  
> # service type
> service.type = A
>  
>  
> And we are declaring the service such a way in Spring DM: (the service that 
> going to be registered is based on the “service.type” value in the config 
> file).
> Is this doable in OSGI declarative services?
>                 
>                                 <image001.png>
>  
>  
> Thank you so much for your time.
>  
> Best regards,
> Kim
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org <mailto:osgi-dev@mail.osgi.org>
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> <https://mail.osgi.org/mailman/listinfo/osgi-dev>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to