문제

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