Module RelayOSGi runtime fieldbook
OSGi · Dynamic Module SystemsView Markdown source

Decision guide, migration, interview, and glossary

The strongest OSGi engineer knows both how to use it and when not to.

Choosing the runtime

Need Good starting point
Small embedded/hosted dynamic framework Felix Framework
Eclipse RCP, IDE tooling, p2 product Equinox + PDE/p2
Managed server runtime, shell, features Karaf
Bundle creation and resolution bnd/Bndtools or bnd Maven/Gradle plugins
Annotation-first components Declarative Services
Existing Karaf/Camel/CXF XML assembly Blueprint where already appropriate

OSGi versus JPMS

JPMS gives Java-platform modules and strong static readability. OSGi gives versioned packages, resolver metadata, lifecycle, and dynamic services. They can coexist but duplicate module descriptors, class loading, reflection, and build tooling require deliberate testing. Do not promise automatic dual modularity.

Migration path

  1. identify package ownership and remove split packages;
  2. separate API from implementation;
  3. add bnd analysis without changing runtime;
  4. baseline public APIs;
  5. introduce services at volatile boundaries;
  6. resolve a small application closure;
  7. add DS and framework integration tests;
  8. move operations/configuration only when the value is clear.

Interview frame: BUNDLE

  • Boundaries: exported APIs and private implementation
  • Uses/wiring: requirements, capabilities, versions
  • Named services: contracts, properties, cardinality
  • Dynamics: bind/unbind, lifecycle, configuration
  • Launch/provision: bndrun, features, p2, runtime
  • Evidence: resolution, tests, health, logs, rollback

Glossary and abbreviations

Term Plain meaning
OSGi Dynamic module and service specifications for Java
Bundle / BSN Modular JAR / Bundle-SymbolicName
Framework Runtime implementing OSGi Core
Wiring Resolved connection between requirement and capability
DS / SCR Declarative Services / its Service Component Runtime
CM / Metatype Configuration Admin / configuration-description standard
RSA Remote Service Admin
HTTP WB / JAX-RS WB HTTP / Jakarta REST Whiteboard
bnd / bndrun Build-analysis tool / runtime-resolution description
Gogo Dynamic command shell used by Felix and Karaf
KAR Karaf archive containing features and artifacts
PDE / p2 Eclipse plug-in development / provisioning system
RCP Eclipse Rich Client Platform
API / SPI Consumer-facing contract / provider extension contract
PID / factory PID Configuration identity / multi-instance configuration identity
LDAP filter Parenthesized service/capability matching expression
EE Java execution environment requirement
SLA / SLO Agreement / measurable reliability objective
SBOM Software bill of materials

Official references

Final Feynman challenge

Explain one ChargeGrid command from bundle resolution to service selection, configuration, remote I/O, failure, telemetry, update, and rollback. Anything you cannot explain without the word “magic” is your next lab.

Module RelayIndependent study material · verify runtime details in official project documentation