Book Image

Learning Karaf Cellar

By : Jean Baptiste Onofre, Jean-Baptiste Onofré
Book Image

Learning Karaf Cellar

By: Jean Baptiste Onofre, Jean-Baptiste Onofré

Overview of this book

Table of Contents (16 chapters)

Listeners and synchronizers

If we use the cluster:* commands to manage the resources in the cluster (features, bundles, configurations, OBR, and local events), Cellar also listens to the changes in the local resources and broadcasts these changes in the cluster.

For instance, if you install a bundle locally (using the osgi:install command), Cellar will catch this change and broadcast it in the cluster event, meaning that all other nodes in the same cluster group as the local node will install the same bundle.

Cellar provides the following listeners:

  • A listener for the features repository and features (install and uninstall)

  • A listener for bundles (install, uninstall, start, stop, and so on)

  • A listener for configurations (propset, propdel, delete, and so on)

On the other hand, when a node starts or joins a cluster group, Cellar invokes a set of synchronizers. The purpose of a synchronizer is to align the local state of the node with the state of the resources in the cluster. A synchronizer is responsible...