문제

I am newbie to osgi and it may be the reason of such simple question.

A have a osgi bundle. Inside I have service,activator and pojo. Instance of pojo I create in activator.

How can I pass the reference of pojo to service before anyone uses this service?

The only way that comes to my mind is to access service as a standard service and use default identifier for setter, but it's not so good solution. CDI is not used.

도움이 되었습니까?

해결책

Who creates the instance of the service? If your activator, then pass the POJO to your service directly. If Declatative Services create your service, have the POJO be accessible using static methods from the activator.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top