OSGi technology is becoming the preferred approach for creating highly modular and dynamically extensible applications. The OSGi framework specification defines a platform for creating applications from loosely coupled components and is rapidly gaining ground as the de-facto plugin solution for Java-based applications. The Eclipse IDE was the first highly visible project to adopt OSGi technology a few years ago, but more and more projects are moving in the same direction. With framework implementations like Apache Felix and Eclipse Equinox readily available, there is no better time to start moving to OSGi technology.
This tutorial focuses on integrating OSGi technology into your applications. It will use the new OSGi RFC 132 API to show how to launch and embed OSGi frameworks in your own projects and the issues around doing so. Building your application on top of the OSGi framework provides tremendous benefits but there is a learning curve. By attending this tutorial, you will receive enough information to immediately start using OSGi as a dynamically extensible plugin mechanism in your own applications, additionally providing them the benefits of module version management, dependency resolution, and lifecycle control.
A simple paint program will be used to illustrate how to take advantage of OSGi technology. The paint program allows the user to paint various shapes, such as circles, squares, and triangles. We will start with an initial paint program implementation that follows an interfaced-based approach with logical package structuring, so it is amenable to modularization, but packaged as a single JAR file. Subsequently, we will divide the program into bundles so we can enhance and enforce its modularity. Finally, we will introduce and implement two different ways of extending the program using the two dominant OSGi usage patterns: the extender and the whiteboard patterns.
Participants will learn:
Participants must have working Java knowledge. Understanding of the OSGi specifications and hands-on experience with bundles and services is a plus.
In order to take part in the hands-on work of the session please bring a laptop with a working VMWare Player installation and CD access. We will provide a VMware image containing the workshop environment and assignments. In case a VMWare Player installation is not an option for you, please make sure you have a working java 1.5 set-up.
Richard is the OSGi dude for the GlassFish team at Sun Microsystems. He has been working with OSGi technology since 2000 and has been participating in the OSGi Alliance since 2004. He is the chair of the Apache Felix project and is interested in component and service orientation for the purposes of dynamically assembling applications. Richard received his Ph.D. from the University of Colorado at Boulder focusing on the area of software deployment.