What is Service Registry in cq? | Community
Skip to main content
Level 9
October 16, 2015
Solved

What is Service Registry in cq?

  • October 16, 2015
  • 4 replies
  • 1837 views

Hi All,

Any thoughts/explanation/good references to this would be helpful.

Also, what exactly is the use of this.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ratna_Kumar

Hi ,

Thanks to reaching out to Adobe Community!!!

The Link is working fine as given by Scott. If this is not working then follow this alternative link: http://docs.spring.io/spring-osgi/docs/current/reference/html/service-registry.html

Note: Both the links are one and the same!!

Thanks,
Ratna Kumar.

4 replies

Ratna_Kumar
Ratna_KumarAccepted solution
Level 10
October 16, 2015

Hi ,

Thanks to reaching out to Adobe Community!!!

The Link is working fine as given by Scott. If this is not working then follow this alternative link: http://docs.spring.io/spring-osgi/docs/current/reference/html/service-registry.html

Note: Both the links are one and the same!!

Thanks,
Ratna Kumar.

February 19, 2024

link is not working yet

askdctmAuthor
Level 9
October 16, 2015

Hi Scott,

Thank you for your reply.

The link provided doesn't seem to be working. Also, would it be possible to provide  reference to an article which explains this in a simple way..

smacdonald2008
Level 10
October 16, 2015

Good discussion on this subject here:

http://www.eclipse.org/gemini/blueprint/documentation/reference/1.0.2.RELEASE/html/service-registry.html

First paragraph:

The OSGi service registry enables a bundle to publish objects to a shared registry, advertised via a given set of Java interfaces. Published services also have service properties associated with them in the registry. The registry is a crucial feature of OSGi, facilitating decoupling between bundles by promoting a dynamic collaborative model based on a service-oriented paradigm (publish/find/bind).

February 19, 2024

The OSGi service registry is a core component of the OSGi framework, serving as a central directory for dynamic service sharing between different modules (called "bundles") within an application. Here's a breakdown of its key features:

What it is:

  • A shared repository where bundles can:
    • Register services: This means making an object available to other bundles by advertising it under one or more Java interfaces.
    • Discover services: Bundles can search for services based on their interfaces and optional properties.
    • Bind to services: Once a service is found, a bundle can acquire a reference to it and use its functionality.

Key features:

  • Dynamic: Services can be registered and unregistered at any time, allowing applications to adapt to changing needs.
  • Decoupled: Bundles do not need to know the specific implementation details of a service, just its interface. This fosters modularity and loose coupling.
  • Filtered searches: Bundles can specify filters when searching for services, allowing them to find specific implementations based on properties or other criteria.
  • Lifecycle management: The service registry tracks the lifecycle of registered services, notifying interested bundles when their availability changes.

Benefits:

  • Loose coupling: Promotes modularity and reduces dependencies between bundles.
  • Dynamic service discovery: Enables flexible and adaptable applications.
  • Service sharing: Allows efficient reuse of code across different parts of an application.
  • Declarative configuration: Simplified service management through declarative mechanisms like Spring DM or Blueprint.

Examples of use:

  • A logging service offered by one bundle can be used by other bundles for logging messages.
  • A persistence service for storing data can be accessed by various bundles needing data storage.
  • A user authentication service can be shared across different modules handling user interactions.

Further resources:

I hope this explanation provides a clearer understanding of the OSGi service registry!