Showing posts with label osgi framework. Show all posts
Showing posts with label osgi framework. Show all posts

Monday, 29 July 2019

OSGi Basics

OSGi is specification and set of standards to develop Java based modular applications.

1. OSGi Framework : It is runtime (OSGi Container) & development environment.
2. Bundle : Basic unit to deploy into the OSGi container. It is a JAR file which contains executable code and OSGi headers in its MANIFEST.MF file.

Bundle = MANIFEST.MF + Java classes + Resources.

             a. Symantic versioning : Major . Minor . Micro - Qualifier (3.0.0-BETA).
             Eg. [1.2, 3.0) (means version 1.2 onwards and upto 3.0 not included 3.0 version)

             b. Bundle lifecycle managed by BundleActivator.

             States are :
                 1. installed (after added into the container), 2. Resolved (all imported dependencies are resolved ), 3. Starting, 4. Active, 5. Stopping, 6. Unistalling.


3. Component : It is an object (java class) which has set of functionalities. It is managed by component framework.
             Component Lifecycle : 1. active, 2. activated. 3. deactivated
4. Service : It is a component registered to OSGi Container 'service registry'.
                   Implements an interface and referenced by its interface in the OSGi Container.