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
0
votes
2 answers

Per-Context services in OSGi

I'm designing an application whose functionality need to be the same in different contexts. Let refer to the picture below: +----+ +----+ +----+ |B1 +--->-----+B2 +-->----+B3 | …
0
votes
3 answers

Service.FindHook event was'nt called by adding service reference to a component

Today I worked a little bit with OSGi Hooks, specially with FindHook and EventListenerHook for services. I wanted to try out proxying services. The EventListenerHook works fine and my services are proxied. But I realized that the FindHook event…
christian.vogel
  • 2,117
  • 18
  • 22
0
votes
1 answer

How do I fail in my declarative services activator?

What's the best way to fail in the activate() method of my declarative service when I know the failure is unrecoverable? Specifically: my service is configurable via configadmin with metatype properties. If the configuration is invalid (say a…
Chris Dolan
  • 8,905
  • 2
  • 35
  • 73
1 2 3
13
14