Dynamic target for declarative service in OSGI

后端 未结 1 776
粉色の甜心
粉色の甜心 2021-01-24 14:44

Given a consumer which uses a service, how can this consumer select a specific provider dynamically using declarative service ?

Example

Service.java



        
相关标签:
1条回答
  • Components of Declarative Services can be configured via ConfigurationAdmin. By doing that, the configuration of the component can be changed at runtime.

    You can also change the configuration of myService.target via ConfigurationAdmin at runtime. If you do that, another reference will be bound to your component.

    If the policy of the reference of your component is dynamic, the new reference will be bound without reactivating your component.

    For more information, see the Declarative Services chapter of the OSGi Compendium specification.

    0 讨论(0)
提交回复
热议问题