declarative-services

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

[亡魂溺海] 提交于 2019-12-03 08:29:00
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 bundle--well, that's the theory. The problem comes about because the ui bundle (with the Views and the Facade) communicate with the other bundle (call it the DataStore) using Declarative Services. Since the Data Store receives asynchronous data updates from yet

Dynamic target for declarative service in OSGI

こ雲淡風輕ζ 提交于 2019-12-02 04:38:31
Given a consumer which uses a service, how can this consumer select a specific provider dynamically using declarative service ? Example Service.java public interface Service { public void do(); } Provider1.java public class Provider1 implements Service { @Override public void do(){ //a way } } Provider2.java public class Provider2 implements Service { @Override public void do(){ //another way } } Consumer.java public class Consumer { private Service myService; protected void bindService(Service s){ // Actually it's Provider1 myService = s; } protected void unbindService(Service s){ myService =

OSGi Declarative Services vs. ManagedService for configuring service?

女生的网名这么多〃 提交于 2019-11-28 21:37:17
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 seems to me like this functionality is quite similar to that provided by implementing the ManagedService interface and publishing that as one of the "services" you provide. It seems like I could completely ignore ManagedService & just use the DS configuration

OSGi Declarative Services vs. ManagedService for configuring service?

丶灬走出姿态 提交于 2019-11-27 13:59:48
问题 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 seems to me like this functionality is quite similar to that provided by implementing the ManagedService interface and publishing that as one of the