I have this scenario, I have three declarative services that provide the same interface (say, the reader interface, and I have readimpl1-database-readerimpl2-flat file-readerimpl3-memory). I want to have a consumer who only contacts the database implementation. In the definition of a component, we give it a name, so I'm sure that the name is in the registry, so if I need to add an activation method, I can search for it from the component context using the name.
I want to try using bind / unbind using the service name as a parameter. I am pretty sure that the βtargetβ parameter in the component reference element can be used for this, but I have not found how to use it.
Has anyone else done this?
It will be like using @Reference (mapped- name = "Foo")
osgi declarative-services
el_eduardo
source share