Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

GridRegistry

Philipp Haussleiter edited this page Nov 25, 2015 · 1 revision

Grid Registry

The Grid Registry is actually not a service and not a bundle. It’s a library.

This is because it needs to be accessible from the code that is woven into the local service classes. In this code we have no way to obtain a BundleContext and therefore we cannot obtain a regular reference to the registry. But we can get an instance of a registry singleton via a static getInstance() method. And that’s what we need to do.

The registry library is deployed into the system via a framework extension bundle – that is the GridWeaver. Therefore, as it is loaded with the framework’s classloader it is accessible from all other bundles that import the OSGi framework. This also ensures that we really only have one instance, stored in a class variable.

The data the registry exposes to the grid is organized in a hierarchy.

+Grid
    +Node
       +Bundle

Each node also has properties like a manager url, a repository url, free/max memory. For other bundles, the Grid is a read-only datastructure that can be manipulated through methods in the RegistryImpl class.

Internally, the registry runs a server and binds to an IP address. If you’d like to specify the address it tells other nodes to communicate with, you can do so with the system property org.bundlebee.registry.localaddress.

Clone this wiki locally