Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.29 KB

File metadata and controls

32 lines (21 loc) · 1.29 KB

Configuration Manager Browser JS

A simple example showcasing the ConfigAdmin capabilities with a Localstorage Persistence Manager implementation.

Running the example

  • Run pnpm run build first in the project root to create local artifacts
  • Run ./cp-dependencies.sh to copy library artifacts
  • Run npx serve dist in this folder to start a web server

Server will start at: http://localhost:3000

Configuration mutation

The Configuration Management Bundle is installed as soon as it can resolve it's dependencies.

The CM Service will find the ManagedServiceTest Service registration when it starts, and if the CM Service can find a corresponding PID stored in the Localstorage, then it will call ManagedServiceTest 's updated() method.

3 seconds later another Bundle will be installed: config-admin-manager.js. This Bundle in it's own activator will update the PID's configuration (test.pid) regardless of any pre-defined value.

Every change triggering the updated() method of ManagedServiceTest will trigger a log message.

Bundle Requirements

Any Bundle which wants to register a ManagedService Must require:

{
  "Require-Capability": "@pandino/pandino-configuration-management;filter:=(objectClass=\"@pandino/pandino-configuration-management/ManagedService\")"
}