Hlavní menu


UvodDoKomponent / KomponentTutorialTeorie2

View (print) - Edit page | Recent changes - Page history

Updated 16 December 2009, 10:19 by Snajberk

OSGi Overview

OSGi is a module system for Java that implements a dynamic component model. Applications demodularized into components can be installed, started, stopped, updated and uninstalled without requiring stopping of JVM.

Components are called bundles and they are based on the common jar file format. This format is extended to be able to desribe dependencies between bundles.

OSGi Class Loaders

The most valuable feature of OSGi, which led to expansions of OSGi, is the principle of module class loaders. On the contrary to basic Java class loading system in OSGi all resolved bundles have theirs own class loader. It helps to create encapsulated modules with defined dependencies.

OSGi Players

OSGi technology was developed by OSGi Alliance. It is defined by OSGi Specification and implemented by OSGi framework. Several independently implemented OSGi frameworks exist today, including four that are available as open source software.

    * Felix -- is a community implementation of the OSGi Release 4.x under the Apache Foundation. It is designed particularly for compactnes and ease of embedding, and is the smallest of the Release 4 implementations.
    * Equinox -- is the most widely deployed OSGi framework today owing to its use in the core runtime of Eclipse. It can also be found in many in-house custom applications as well as packaged products such as Lotus Notes and IBM WebSphere? Application Server. Equinox implements Release 4.1 of the OSGi specifications.
    * Knopflerfish -- is a popular and mature implementation of both OSGi Release 3 and Release 4.1 specifications. It is developed and maintained by Makewave, a company based in Sweden, and is licensed under a BSD-style license.
    * Concierge -- is a very compact and highly optimized implementation of OSGi Release 3. This makes it particularly suited to resource-constrained platforms such as mobile phones.

OSGi Tutorials

Now when you have theoretical and technological background, you can start with tutorials. There is thousands of tutorials for OSGi. Some of them are excellent, some of them are good. Ergo there was no need to create yet another one. Instead I choose two tutorials, I find really valuable. First is for Equinox, second for Felix. Both cover similar use cases of OSGi, but both describe worthwiling details. You can choose one of them or try both.

Equinox Tutorial

Neil Bartlett wrote a Getting Started series on EclipseZone? that uses Equinox. This tutorial has eight parts. First six parts are dedicated to standard (old) OSGi (services). The last two parts describe Declarative Services -- these parts are optional.

Felix Tutorial

Felix tutorial was prepared by Apache Felix team members. This tutorial has nine parts and i would recommend all of them. Next three parts are work in progress.