활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
I have three bundles named Bundle1,Bundle2 & Bundle3. I have two services with the same interface in bundle 2 & 3 and need to refer this interface in bundle 1. How can that be done? How do I specify the interface with its versions that needs to be exported and imported respectively in two different bundles?
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
You may register Services(interface implementations) with different properties(e.g. version) and export them. You may then reference the services with the target attribute. See section "Targeting a service implementation" : https://www.deptagency.com/insight/binding-and-unbinding-osgi-services-in-aem/
Thanks,
Wasil
You may register Services(interface implementations) with different properties(e.g. version) and export them. You may then reference the services with the target attribute. See section "Targeting a service implementation" : https://www.deptagency.com/insight/binding-and-unbinding-osgi-services-in-aem/
Thanks,
Wasil
Hi @Manasi29
You need to ensure that the other bundle can reference that OSGI Service
for more information please visit this blog https://www.techinnovia.com/package-import-and-export/
Hope that helps you!
Regards,
Santosh
Hi @Manasi29
There are multiple ways /options in getting the service we need via interface(binding respective service).Please refer my below blog where i provided all options with sample code.
https://rajashankardigital.blogspot.com/2021/08/control-dependency-injection-in-osgi.html
Regards,
Rajashankar.R