Learn about OSGi applications

The OSGi applications framework provides a programming model for developing, assembling, and deploying modular applications that use Java™ EE and OSGi technologies. OSGi application development tools provide a way to build enterprise applications that benefit from the modularity, dynamism, version control, and third-party library integration that is provided by the OSGi applications framework.

Overview

You can read the following topics before you create an OSGi application. They provide planning and technology overview information that might be useful if you are new to OSGi application development or developing OSGi applications in this development environment.

Conceptual information icon.OSGi overview
Conceptual information icon.OSGi Blueprint Container
Conceptual information icon.Tools for OSGi application development

OSGi support in WebSphere Application Server

You can develop the following Java EE applications as OSGi applications:
  • Web applications
  • Java Persistence API (JPA) applications
  • JAX-RS (REST) Web services
  • JavaServer Faces applications
  • XML applications
  • EJBs
Table 1. WebSphere Application Server support for OSGi applications. Table 1 displays the programming models and versions that WebSphere Application server supports.
  Version support in WebSphere® Application Server version 8.5 Version support in Liberty server
Dynamic Web Modules 2.5 and 3.0 2.5 and 3.0
EJBs 3.0 and 3.1 Not supported
Java Persistence API 1.0 and 2.0 1.0 and 2.0
JavaServer Faces 1.1, 1.2, and 2.0 Not supported
JAX-RS 1.1 1.1
JAX-WS   2.2
SIP 1.0 and 1.1
Note: Annotated SIP1.1, or OSGi, applications are not supported
1.0 and 1.1
Table 2. WebSphere Application Server Publish support for OSGi projects
    Supported in WebSphere Application Server version 8.5 Supported in Liberty server
OSGi Applications containing: OSGi Bundles
Supported.
Supported.
OSGi Bundles with EJBs
Supported.
 
OSGi Fragments
Supported.
Supported.
OSGi Composite bundles
Supported.
 
Java EE WAR Modules
Supported.
 
PDE plug-ins
Supported.
Supported.
PDE fragments
Supported.
Supported.
OSGi Composite bundles containing: OSGi Bundles
Supported.
 
OSGi Bundles with EJBs
Supported.
 
OSGi Fragments
Supported.
 
PDE plug-ins
Supported.
 
PDE fragments
Supported.
 

Getting started

If you are already familiar with OSGi development technology, the following topics guide you through the development process.

Task information iconCreate an OSGi bundle project
Task information iconCreate an OSGi application project
Task information iconDeploy the OSGi application

Samples and tutorials

For a complete list of OSGi application development samples and tutorials, refer to OSGi application samples and tutorials. To view the sample and tutorials in this product, click Help > Help Contents and expand the Samples and Tutorials sections.

Learn about different aspects of OSGi application development from the following samples and tutorials:

Sample iconSample: OSGi Hello World
This sample OSGi application contains a servlet that demonstrates the use of an activator.
Sample iconSample: OSGi Counter Service
This sample OSGi application consists of an OSGi web bundle that contains a servlet that accesses a service that is provided in another bundle project. This sample is an introduction to using OSGi application development tools.
Sample iconSample: OSGi Blog
This sample OSGi application demonstrates how to structure the API and implementation code into separate bundles. The OSGi application consists of an OSGi web bundle that contains servlets that access a JPA service that is provided in another bundle.
Sample iconSample: EJB temperature converter
This OSGi sample demonstrates an EJB configured as an OSGi bundle and exposed as a service.
Tutorial iconTutorial: Develop a simple OSGi application
This tutorial demonstrates how to create an OSGi application and run it on WebSphere Application Server. The OSGi application consists of an OSGi web bundle that contains a servlet that accesses a service that is provided in another bundle project. This tutorial is an introduction to using OSGi application development tools.
Tutorial iconTutorial: OSGi EJB service
This tutorial demonstrates how to create an OSGi application that exposes an EJB as a service. It demonstrates how to create OSGi bundles with EJB support, use the OSGi tools to manage EJB exports, and create a servlet that accesses the EJB as an OSGi service.

Web resources for learning

In addition to the information found in this information center, the following links provide extra learning material.

developerWorks article. Developing enterprise OSGi applications for WebSphere Application Server

developerWorks article.Best practices for developing and working with OSGi applications

developerWorks article. Innovations within reach: Are we ready for enterprise OSGi?