October 2008

"...the OSGi Alliance is about managing this overwhelming sea of components and their interaction. It is about being in control of the thousands of dependencies that software has to internal and external artifacts. It is a framework that addresses the heart of the software development process. It is about managing the software development, deployment and the, most expensive one, the maintenance process."

OSGi Blog

The TIM Lecture Series provides a forum that promotes the exchange of knowledge between university research and technology company executives and entrepreneurs. Readers outside the Ottawa area who are unable to attend the lectures in person are invited to view upcoming lectures in the series either through voice conferencing or webcast.

On August 27, 2008, Dwight Deugo from Carleton University delivered a presentation entitled "OSGi and Server-Side Eclipse". This lecture introduced the fundamental concepts of OSGi, a component integration platform to provide interoperability of applications and services. It also discussed how the Equinox project has incorporated OSGi into the Eclipse platform and gave an overview of the impact it has had on Server-Side Eclipse. This report provides the key messages from the lecture.

Background & Framework

The first half of this lecture provided an overview of the OSGi Alliance. According to its website, the "OSGi Alliance is a worldwide consortium of technology innovators that advances a proven and mature process to assure interoperability of applications and services based on its component integration platform. The OSGi Service Platform is delivered in many Fortune Global 100 company products and services and in diverse markets including enterprise, mobile, home, telematics and consumer. The alliance provides specifications, reference implementations, test suites and certification to foster a valuable cross-industry ecosystem. Member companies collaborate within an egalitarian, equitable and transparent environment and promote adoption of OSGi technology through business benefits, user experiences and forums."

Dwight explained the advantages of using OSGi in practical terms. Over the years, software has become more complex, increasing the need for collaborative frameworks. In particular, restarting software is problematic for distributed systems and systems that need to be always available. The OSGi attempts to solve this problem for Java by using bundles which can be individually installed, uninstalled, upgraded, started, and stopped without having to restart the rest of the system. Moreover, OSGi is an important framework as it represents the collaborative talent of a consortia of vendors.

The audience asked about other frameworks which attempt to solve this or similar problems. Jini is another framework that attempts to solve the restart problem, but it was developed by one vendor (Sun). It is doubtful that OSGi will be replaced by Jini as the OSGi community is very strong. OSGi does not really compare to EC2 as EC2 uses virtual machines rather than bundles. OSGi is not meant to replace Maven as OSGi manages runtime dependencies rather than buildtime dependencies. From the presenter's experience, OSGi pulls down the first dependency it finds, meaning conflicting dependencies need to be addressed during the development process. Lazy starting in the bundle manifest is one way to optimize bundles. OSGi is specific to Java and Dr. Deugo was not aware of any frameworks based on OSGi for other languages. There are, however, many home-grown examples of non-OSGi solutions; an example would be the download feature of an antivirus project.

It was noted that there were very few telecoms represented in the consortia; a similar standard for this industry would be very useful.

Eclipse Equinox & Server Side

Dwight started this section with a demonstration of two OSGi implementations: knopflerfish and Eclipse Equinox. The "goal of the Equinox project is to be a first class OSGi community and foster the vision of Eclipse as a landscape of bundles." He also provided several key messages for the Java developer:

  • when converting to a server side implementation, you can either embed the web application into OSGi or give the WAR file to Tomcat which treats Equinox as a servlet
  • when creating OSGi servlets, you still need to follow the servlet API
  • you can encapsulate existing servlets into an OSGi bundle, thus gaining all of the benefits of a bundle
  • OSGi bundles force the developer to deal with services (e.g. stopping, starting) and dependencies early in the development cycle

Recommended Resources

Modular Java Web Applications

The Equinox Community: Runtime Technology at Eclipse

Share this article:

Cite this article:

Rate This Content: 
No votes have been cast yet. Have your say!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.