Be aware that if you're migrating from Spring to DS, DS has a much more limited scope than Spring-DM. DS is basically limited to configuration and registering / importing OGSi services.
In your simple example, you'll have to trick things a bit in order to use DS. You won't be able to inject a bean into another bean without going through the OSGi registry. In order to do that, you'll have to use Blueprint. Another alternative is something i'm working on, which is a CDI / OSGi integration based on DS. Looks promising so far. Guillaume 2016-05-16 5:52 GMT+02:00 Chong, Kim Theng <kimtheng.ch...@experian.com>: > 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. > > > > > > 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? > > > > > > > > > > Thank you so much for your time. > > > > Best regards, > > Kim > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev > -- ----------------------- Guillaume Nodet ------------------------ Red Hat, Open Source Integration Email: gno...@redhat.com Web: http://fusesource.com Blog: http://gnodet.blogspot.com/
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev