質問

When I use OSGi API (an instance of ServiceRegistration) I can easily change the properties of service at runtime. How can I do the same with declarative service ? Is there any solution based on BndTool's annotation?

Many Thanks

役に立ちましたか?

解決

The answer is no. A service registered by DS for a component gets is service properties from the component properties. The component properties are set by the component description in the XML and also any Config Admin configuration used. Since you cannot change the XML, you can only change the configuration which is not something a component itself is expected to do.

If you need to change your service's service properties on the fly, your use case falls outside of the use cases supported by DS. You will need to use the OSGi service API.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top