I am developing an RCP application based on Eclipse 4 application platform.
My application consists of several own OSGi bundles implemented as declarative services. Now I want to make use of the IEventBroker
service which I can use in my application quite nicely.
But is it possible to use the IEventBroker
service in my separate bundles? Injecting the service as field does not work:
@Inject IEventBroker eventBroker;
And injecting the service in constructor of my class does not work also:
@Inject
public TestUserService(IEventBroker eventBroker) {
..
}
The injected eventBroker
is NULL
every time. Is the usage of IEventBroker
possible in own OSGi bundles in general? Do I have to add any required plugins into my bundle? Is there another way to get such services into own OSGi bundles?