declarative-services

How do you communicate between eclipse declarative services and Views (ContentProviders)

Say you have an eclipse plugin with various views, these views should display data from some OSGi bundle that pushes data to the Views. Rather than have every view communicate with the OSGi bundle, I have an intermediate Facade class that acts as a blackboard for the views and manages communications between the views and the other OSGi ...

What is the proper way of disabling an OSGi service at service start?

I have created an OSGi bundle with an exposed (declarative) service. If I, when activate is called, notice that something is amiss such that I can not provide the service, I need to prevent it from being exposed. At the moment the activation function looks like so: public void activate(ComponentContext context, Map<String, Object> prope...

How to construct an OSGi service with dependencies and publish via DS

My sample classes: public class MyModel implements Model { : : } public class SingleModelProvider implements ModelProvider { public SingleModelProvider(Model providedModel, List actions) { : } } The plan is to reuse the SingleModelProvider class in several bundles to provide different implementations of ...

OSGi Declarative Services vs. ManagedService for configuring service?

I just recently stumbled upon the fact that Declarative Services in OSGi can set the configuration of a component to required so that the component receives it upon activation, removing the gap between component activation and configuration. I also realized with this that you can receive configuration updates via the modified method. It...