The OSGi framework defines a dynamic modular system for Java that allows you to better control the structure of your code, dynamically manage the life cycle of your code, and provides a loosely coupled approach to code writing, and more notably, its specification documentation is exhaustive. --"OSGi combat"
OSGi tiering Architecture
Service Layer |
Focus on the interaction and communication between the modules, especially the components within the module. |
Life cycle Layer |
Focus on providing execution-time module management and access to the underlying OSGi framework. |
Module layer |
Focus on packaging and sharing code |
BUNDLE:OSGI defines the concrete implementation of its modular concept, containing code, resources, and metadata in the form of a jar file.
The main difference between bundles and ordinary jars is metadata, which uses metadata to manage its modular features, which are stored in the meta-inf/manifest of the jar file. MF in.
Life Cycle API
Bundleactivator (Start, stop): is a bundle entry, similar to the main method in Java.
Bundlecontext: Provides a way for an application to manipulate the OSGi framework when executing.
Bundle: Represents a bundle that has been installed into the framework, allowing state operations on it.
Maven Plugin: Maven-bundle-plugin
OSGi Getting Started notes