declarative-services

How can i add Declarative Services support to embedded felix in Netbeans?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 00:44:33
问题 In netbeans, embedded felix does not support DS.How can we add Felix Service Component Runtime to embedded felix in netbeans. 回答1: Declarative Services is implemented by an ordinary bundle, called SCR (Service Component Runtime). Simply install that bundle! Look for SCR on the Felix downloads page: http://felix.apache.org/downloads.cgi 来源: https://stackoverflow.com/questions/19152649/how-can-i-add-declarative-services-support-to-embedded-felix-in-netbeans

Backporting OSGI DS component to OSGI R4

不羁的心 提交于 2019-12-11 05:48:31
问题 I have a component which was developed for Apache Karaf 4.0.5. However, it turns out it needs to be deployed on glassfish 4, which is based on an older version of Felix. I get this message when trying to deploy it: missing requirement [319.0] osgi.extender; (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0))) However, my pom file does not show any explicit dependency on osgi.component. I think I must have used some OSGI R5 (or R6?) specific feature, but I don't know which

Order of service binding with declarative services

江枫思渺然 提交于 2019-12-08 07:32:56
问题 Is there a way to find out or to determine the order of service binding with declarative services? My problem is that I have a logging service running in my OSGI among other services. Now, my component binds this logging service and a couple of other services. I want to write a log message each time a service is bound or unbound. However, if service A is bound before my logging service, no log entry for A can be written. Can I configure the binding order somehow? I read about setting the

Bind order of OSGi declarative services

时光总嘲笑我的痴心妄想 提交于 2019-12-07 17:40:46
问题 Assuming I use OSGi Declarative Services and I have a service that have a number references with policy = dynamic... A - Mandatory unary. B - Mandatory unary. C - Mandatory multiple. D - Optional unary. E - Optional multiple. All references are available when my service starts. Is there any way to control what order bind is called in? I'd like to have B bind first and do something to each E that comes in, but I have no way of ensuring that B is bound before E. Yes, the more logical approach

Issues with GWT in OSGi+Pax-Web using Declarative Services

断了今生、忘了曾经 提交于 2019-12-07 14:18:20
问题 I'm migrating an existing GWT app running on OSGi (Equinox) and Pax-web to use Declarative Services instead of programmatic Service Tracker. I'm using Pax-Web in Equinox. A WAR-based GWT application is loaded with no problems by PAX-WEB War extender, but you cannot have Declarative Services in this modus operandis. I successfully refactored all servlets out of the war and converted them into declarative OSGi services ( <provide interface="javax.servlet.Servlet"/> ). That way I got rid of all

Issues with GWT in OSGi+Pax-Web using Declarative Services

走远了吗. 提交于 2019-12-06 02:36:14
I'm migrating an existing GWT app running on OSGi (Equinox) and Pax-web to use Declarative Services instead of programmatic Service Tracker. I'm using Pax-Web in Equinox. A WAR-based GWT application is loaded with no problems by PAX-WEB War extender, but you cannot have Declarative Services in this modus operandis. I successfully refactored all servlets out of the war and converted them into declarative OSGi services ( <provide interface="javax.servlet.Servlet"/> ). That way I got rid of all the messy ServiceTracker code and specific OSGi dependencies in the servlets. I further replicated all

Bind order of OSGi declarative services

回眸只為那壹抹淺笑 提交于 2019-12-06 02:14:43
Assuming I use OSGi Declarative Services and I have a service that have a number references with policy = dynamic... A - Mandatory unary. B - Mandatory unary. C - Mandatory multiple. D - Optional unary. E - Optional multiple. All references are available when my service starts. Is there any way to control what order bind is called in? I'd like to have B bind first and do something to each E that comes in, but I have no way of ensuring that B is bound before E. Yes, the more logical approach would be to let the service that represents B also bind to E and do whatever it should do, but I can't

Eclipse RCP 4 use bundle via declarative service

纵然是瞬间 提交于 2019-12-05 11:44:55
I have written an OSGi bundle to use it in my eclipse 4 rcp application. The usage of the service works fine if I add the dependencies, register these service in my activator and inject it in my class. In activator IUserService service = new TestUserService(); context.registerService(IUserService.class.getName(), service, null); In my class @Inject IUserService service; service.getSth(); I read that using bundles via declarative services should be the better way. So changed my implementation. I created a component definition in my bundle to provide my service: <?xml version="1.0" encoding="UTF

How do you properly implement a ManagedServiceFactory as Decalarative Service in OSGi?

◇◆丶佛笑我妖孽 提交于 2019-12-04 17:11:35
I have services that need to be created on a per-configuration base, each of which relies on an external resource and thus should manage it's own lifcycle (i.e. (de)register the service). Thus implementing these as DS and let SCR spawn multiple instances does not work. One can implement a bundle that registers a ManagedServiceFactory to accomplish this task perfectly (see my previous post ). But as a consequence, if the factory depends on several other services, you need to start tracking those services and write a lot of glue code to get everything running. Instead I'd like to implement the

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

别来无恙 提交于 2019-12-04 13:37:25
问题 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