Questions tagged [declarative-services]

Declarative Services (DS) is a component model that simplifies the creation of components that publish and/or reference OSGi Services.

Declarative Services (DS) is a component model that simplifies the creation of components that publish and/or reference OSGi Services. It was first defined in OSGi Release 4.0 and is inspired by an earlier model known as service binder by Richard Hall and Humberto Cervantes.

Its main features are:

  • Declarative : no need to write explicit code to publish or consume services.
  • Lazy : components that publish services are delayed, meaning that the service implementation class is not loaded or instantiated until the service is actually requested by a client.
  • Lifecycle: components have their own lifecycle (i.e. activation and deactivation), bounded by the lifecycle of the bundle in which they are defined.
  • Configuration: components can automatically receive configuration data from Configuration Admin.
198 questions
1
vote
3 answers

Configuration Admin and Declarative Services not created during pax exam test phase

I've written a @component in DS that is supposed to be instantiated and activated in multiple instances. In order to test that I've written a pax exam test where I boot karaf and added scr. Everything works fine, but... it will not instantiate the…
Mario Toffia
  • 510
  • 5
  • 16
1
vote
3 answers

Multiple PIDs for one target service with ds annotations

I'm wondering if it is possible to leverage what is explaned at par.104.7.5 (Using Multi-Locations) of the osgi enterprise specs using declarative services annotations. Quoting the specs: It is also possible that Bundles are interested in multiple…
matteo rulli
  • 1,443
  • 2
  • 18
  • 30
1
vote
1 answer

Callback and passing object reference in OSGi

Bundle-A binds a package from Bundle-B using declarative services in Eclipse Environment. Then Bundle-A sends a message to Bundle-B by passing a 'data' and 'a reference of a class object' that should get the response to this message as an argument.…
Excite
  • 484
  • 1
  • 5
  • 19
1
vote
1 answer

How can I reference all components that implement a given interface?

I am using the Apache Felix Service Component Runtime (SCR) on an Eclipse Equinox OSGi environment. There are several components declared that implement the interface org.example.Producer like:
Henrik Sachse
  • 51,228
  • 7
  • 46
  • 59
1
vote
1 answer

Remote Declarative Services In Equinox

I'm trying to provide a remote declarative service using Eclipse ECF. In the service provider component definition, I have set the following properties: service.exported.interfaces = * service.exported.configs =…
Utku Ufuk
  • 318
  • 1
  • 10
  • 24
1
vote
1 answer

How to configure OSGI Declarative Service scope?

Can someone please explain me how to configure OSGI DS to be a singleton? I use Equinox as OSGi container. SCR component
Butch
  • 13
  • 3
1
vote
1 answer

Could not run Configuration Admin on Eclipse

I am trying to use Configuration Admin to pass configuration info to a bundle. I am using declarative services based on Equinox implementation of OSGI. First of all since I couldn't find the Equinox implementation of Config Admin I have installed…
Excite
  • 484
  • 1
  • 5
  • 19
1
vote
1 answer

Starting OSGI Declarative Services causing thread error

I have an RCP 3.7 application that requires two database connections, the code for each database is in a separate bundle. Previously the database startup was done in the Activator.start() methods. I have heavily refactored the code to move the…
Timothy Vogel
  • 1,363
  • 2
  • 21
  • 39
1
vote
3 answers

Generates the OSGI-INF/serviceComponent.xml using gradle

OSGI-INF/serviceComponent.xml can be generated using maven scr felix plugin by adding dependency like org.apache.felix maven-scr-plugin 1.15.0
saviour23
  • 13
  • 3
1
vote
1 answer

Gradle not generating SERVICE_COMPONENT when using DS Annotations

I'm using Declarative Services annotations in my project along with gradle. I have specified the respective annotations (@Component etc) in my Component classes. I have also added the dependency for the felix scr annotations projects in the gradle…
1
vote
2 answers

Trying to create an abstract bundle in OSGI

I'd like to create something as an abstract bundle in OSGI. The idea is that when let's say bundle Ax (x going from 1 to 9) needs to bind to bundle B through a service provided by B, this could be done more easily by making asbtractA (so Ax extends…
Spyral
  • 760
  • 1
  • 12
  • 33
1
vote
1 answer

OSGi Services: Requesting a Bundle's/Component's Referenced Services

I’m currently “struggling” with OSGi services, or to be more specific, with the wiring between the services. I’m aware of the basics of DS, SCR and the general strategies for a component instance to acquire services. Anyway, here is my…
don
  • 11
  • 1
1
vote
2 answers

OSGi: What happens when an imported service is stopped while the service is still running

Say I am using a service A which is imported in another service B. While B is running normally(ofcourse A is Active), what will happen is service A is uninstalled while service B is still running? Service A -> Service B What will be the different…
Amrit
  • 2,295
  • 4
  • 25
  • 42
1
vote
0 answers

WAS 8.5 - Can a blueprint managed OSGI service have a reference to a declarative services managed OSGI service?

We use WebSphere 8.5 (NON-Liberty Profile… just straight-up WAS) and we have a Spring 3.2 web app that is accessing an OSGI service which is using the blueprint component model via an SCA service bridge. We did this this way because to our…
1
vote
1 answer

Unsatisfied reference in OSGi declarative service component

I have a problem with an unsatisfied reference in an OSGi declarative service component:
claudiopro
  • 339
  • 4
  • 17