Bundle.update: The Year of Modularity
A lot seems to have happened since the last Bundle.udpate, despite the usual vacation slowdown that happens at this time of year.
dm Server moves to Eclipse
Perhaps the biggest news is the proposal of the Virgo project at Eclipse (covered in detail last week). Having just released 2.0.0, this means the follow-on release 2.1 will be developed and distributed under the Eclipse umbrella.
A key difference between the existing project and the new proposal is the licensing. This means that rather than being made available under the GPL, it will instead be made available under the EPL, a more commercially-friendly license. The stated goal of the move was to increase community contributions as well as encourage the de-facto approach for software development:
There is a great deal of interest and innovation around enterprise OSGi and the dm Server. This interest is strongest amongst early adopters, and projects with requirements that match closely to the dynamically modular nature of the OSGi Service Platform. For a mainstream development team though, who just want to build an enterprise application as quickly as possible, and with as little hassle as possible, the costs currently associated with adopting enterprise OSGi can outweigh the short-term benefits. This situation needs to be addressed before enterprise OSGi can become the de-facto approach for mainstream enterprise application development.
OSGi and Equinox published
This week sees the publication of OSGi and Equinox, the first in a new series of Eclipse RunTime books. This describes how to use OSGi to build modular Java applications; and although it's based on Equinox, it should prove a valuable guide for those wishing to develop on other OSGi platforms as well.
The book also works through the Toast example project; the goal is to provide a living set of example code to go with future evolutions of the book series (so that a developer having read one book will be easily able to pick up the context for another). The book is split into four parts: the first, an overview of OSGi; the second is the tutorial building the Toast example; the third is a deep dive into the nuts and bolts of OSGi; and a concluding reference part.
ECF remote services finished
The Eclipse Communications Framework project have completed their implementation of the OSGi Remote Services specification. This includes the ability to connect up OSGi services across VMs using a disparate collection of protocols, including REST, WS-*, JMS, XMPP, Skype and an ECF Generic implementation.
Not only that, but different discovery mechanisms are available as well, such as ZeroConf, SLP as well as static file-based discovery.
The Apache Felix implementation of OSGi Remote Services is available (Apache CXF) and is the reference implementation for OSGi. However, this is focussed on providing access via a WS-* transport layer, whereas ECF is more transport layer agnostic. In both cases, however, the end-user/developer API is the same. This facilitates the replacement of one with another at runtime.
Enterprise Expert Group nearing completion
In a a recent posting, Peter Kriens announced that the OSGi Enterprise Expert Group is nearing completion. As noted last time, the Enterprise Expert Group draft 4 has recently been released, and it provides a number of Java EE features. It is expected that the final version will be released in time for OSGi DevCon, co-hosted with EclipseCon, in March this year.
The EEG will deliver OSGi-enabled mechanisms for performing JDNI type lookups, using JMX to manage OSGi runtimes, providing database access with JTA, JPA and DataSources, as well as administration of Remote Services and Service Component Architecture. In addition, a new deployment bundle type WAB will allow web application bundles to be installed into a container in the same way that WARs are installed into web containers. When the EEG work is published, InfoQ will cover it in more detail.
WebSphere Open Application Alpha
Having been based on OSGi for some time, IBM's WebSphere has recently opened an Alpha for OSGi applications. This is based on Apache Aries and includes the OSGi Blueprint container. (This is similar to Eclipse Gemini, which has been proposed as an Eclipse project by SpringSource.) These projects also aim to solve some of the issues with JNDI and JTA, which are the focus of the upcoming Enterprise Expert Group.
These containers are pushing the boundaries of OSGi runtimes as hosts for multiple applications. In the future, applications may be partitioned (in much the same way that a web application server partitions WARs) using OSGi Nested Frameworks (known as Composite Bundles). Unlike web application servers, where the WARs are entirely separate and share no code, a WAB can integrate with the OSGi runtime to share code and services as easily as using private bundles and services.
Tycho builds OSGi with Maven
Sonatype have released Tycho 0.6.0, working under the new Maven 3 builds. Tycho is a set of Maven builders that can infer dependencies from an OSGi Manifest.MF rather than assuming dependencies exist in the Maven POM. This allows OSGi bundles to be created with Maven using either a POM-first (where the Manifest is automatically generated) or a Manifest-first build process.
Although most OSGi developers using Maven (such as those under the Felix umbrella at Apache) will be more accustomed to POM-first development, the addition of Manifest-first development will make it easier to develop OSGi bundles using Eclipse's increasingly inaccurately named PDE (Plug-in Development Environment).
Notable Eclipse projects using Maven, instead of the Ant-based PDE build, include the Git team provider (http://www.eclipse.org/egit/ and http://www.eclipse.org/jgit/) as well as the incubating Tigerstripe project.
The Maven project is working towards Maven 3, a large refactoring that is moving towards using Google Guice. In addition, the success of the Maven repository (managed by Sonatype) is arguably one of the key reasons that Java development using multiple dependencies is easy. Repositories of OGSi bundles (such as OBR and SpringSource repository) are starting to become more common, but are distributed across different providers. There is exploratory work in providing a federated set of OSGi repositories, consumable by Tycho, using Nexus. Experimental repositories are federated at bundles.sonatype.org and osgi.sonatype.org. The future goal is to provide access via multiple formats (OBR, P2 etc.) so that OSGi bundles can be consumed as easily as Maven JARs can be consumed.
Nimble and POSH
Resolvers for OSGi bundles are becoming more popular, if only to obtain OSGi bundles in a trivial mechanism. Paremus have recently released Nimble, a resolver that can obtain and download OSGi bundles.
Paremus bundles POSH, the Paremus OSGi Shell, with the Nimble resolver. This allows a generic OSGi framework to be initialised and managed using the same set of commands (thus making it easy to test between Felix, Equinox, Knopflerfish etc.). Together with Nimble, it allows an OSGi runtime to be bootstrapped in an efficent manner, as described by Dave Savage. Using the following two commands lets you install and run a Spring-based OSGi web application:
posh -kc "repos -l springdm;add org.springframework.osgi.samples.simplewebapp@active" open http://localhost:8080/simple-web-app/
There's more information about Nimble in an interview on DZone.
OSGi UK User Group and OSGi DevCon London
The OSGi UK User Group is growing, with over 100 members. The most recent presentation was given by Marcel Offermans (of Luminis) and Graham Charters (of IBM). A video recording and presentations will be made available in the near future from the user group website.
The first part was an overview of the incubating Apache ACE, a project that aims to facilitate OSGi provisioning across many (potentially remote) devices.
When assembling software out of reusable components, the task of deploying software onto an ever increasing number of connected devices is not trivial to solve. This becomes even harder when these devices have heterogeneous software stacks and require different components. This presentation will show how software components can be distributed to different types of devices, ranging from mobile phones to nodes in the cloud, based on Apache ACE, an open source, OSGi based provisioning solution.
The Apache Ace project, is based upon software donated by Luminis earlier this year; the software been applied to quite a number of real-life projects for provisioning e.g. On-ship Radar systems, field X-Ray Equipment, Software updates and license management for a Content Management system, and airport baggage handling systems.
OASIS has been developing the Service Component Architecture (SCA) specifications. SCA provides a heterogenous SOA programming model which spans an extensible number of implementation technologies (EJB, BPEL, C++, COBOL), bindings (Web services, JMS, IIOP, etc.) and policy (WS-Policy, etc).
This presentation will give a brief introduction to the OSGi Remote Services and Service Component Architecture technologies. It will then describe how the two can be combined allowing OSGi applications using Remote Services to exploit the variety of SCA implementation technologies, bindings and the policy framework.
It's clear that OSGi adoption in large server systems is becoming commonplace, and that's starting to filter down. However, with build tools making it easier for OSGi bundles to be built in a variety of different IDEs, and new repositories for sharing OSGi bundles are springing up, developing modular Java applications have never been easier. For this reason, Kirk Knoernschild has pronounced 2010 as the year of Java Modularity.
Mike Keane Dec 21, 2014
Jeremy Stieglitz Dec 21, 2014