Thank you for sharing the helpful links ☺

From: [email protected] [mailto:[email protected]] On 
Behalf Of Peter Kriens
Sent: Tuesday, May 17, 2016 5:36 PM
To: OSGi Developer Mail List
Subject: Re: [osgi-dev] Question on dependencies injection and config reading 
in SCR

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/doc/217-ds.html
            
https://github.com/osgi/osgi.enroute.examples/tree/master/osgi.enroute.examples.component.application
            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


On 16 mei 2016, at 05:52, Chong, Kim Theng 
<[email protected]<mailto:[email protected]>> 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
[email protected]<mailto:[email protected]>
https://mail.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to