Developing 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, versioning, and third-party library integration provided by the OSGi applications framework.
Overview
OSGi support in WebSphere Application Server
Getting started
Samples and tutorials
Web resources for learning

Overview

You can read the following topics before creating an OSGi application. They provide planning and technology overview information that may 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
Note: In order to develop OSGi applications using IBM WebSphere Application Server Version 7.0, you must install the Feature Pack for OSGi Applications and Java Persistence API 2.0. For information on installing WebSphere Application Server Version 7.0 Feature Pack for OSGi or WebSphere Application Server Version 8.0, refer to Installing the server.
Table 1. WebSphere Application Server support for OSGi applications
  Versions supported in WebSphere® Application Server version 7.0 Versions supported in WebSphere Application Server versions 8.0 Versions supported in WebSphere Application Server version 8.5 Versions supported in Liberty profile server
Dynamic Web Modules 2.5 2.5 and 3.0 2.5 and 3.0 2.5 and 3.0
EJBs Not supported Not supported 3.0 and 3.1 Not supported
Java Persistence API 1.0 and 2.0 1.0 and 2.0 1.0 and 2.0 1.0 and 2.0
JavaServer Faces 1.1 and 1.2 1.1, 1.2, and 2.0 1.1, 1.2, and 2.0 Not supported
JAX-RS 1.1 1.1 1.1 1.1
SIP 1.0 and 1.1
Note: Annotated SIP1.1/OSGi applications are not supported
1.0 and 1.1
Note: Annotated SIP1.1/OSGi applications are not supported
1.0 and 1.1
Note: Annotated SIP1.1/OSGi applications are not supported
Not supported
Restriction:
The following technologies are not supported by the WebSphere Application Server Version 7.0 OSGi runtime:
  • EJB
  • RPC Adapter
  • Servlet 3.0
  • Web 2.0 Server-side technologies
  • Web 3.0
  • Web services
  • XML Transformations APIs
The following technologies are not supported by the WebSphere Application Server Version 8.0 OSGi runtime:
  • EJB
  • RPC Adapter
  • Web 2.0 Server-side technologies
  • Web services
  • XML Transformations APIs
Table 2. WebSphere Application Server Publish support for OSGi projects
    Supported in WebSphere Application Server version 7.0 Supported in WebSphere Application Server version 8.0 Supported in WebSphere Application Server version 8.5 Supported in Liberty profile server
OSGi Applications containing: OSGi Bundles
Supported.
Supported.
Supported.
Supported.
OSGi Bundles with EJBs    
Supported.
 
OSGi Fragments
Supported.
Supported.
Supported.
Supported.
OSGi Composite bundles  
Supported.
Supported.
 
Java EE WAR Modules
Supported.
Supported.
Supported.
 
PDE plug-ins
Supported.
Supported.
Supported.
Supported.
PDE fragments
Supported.
Supported.
Supported.
Supported.
OSGi Composite bundles containing: OSGi Bundles  
Supported.
Supported.
 
OSGi Bundles with EJBs    
Supported.
 
OSGi Fragments  
Supported.
Supported.
 
PDE plug-ins  
Supported.
Supported.
 
PDE fragments  
Supported.
Supported.
 

Getting started

If you are already familiar with OSGi development technology the following topics will 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 is comprised 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 is comprised of an OSGi web bundle that contains servlets that access a JPA service 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 is comprised 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 infocenter, the following links provide additional 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?

IBM® Redbooks®: Rational® Application Developer V7.5 Programming Guide

IBM Education Assistant for Rational Software Products


Feedback