Chapter 4. Packaging your enterprise OSGi applications

 

This chapter covers

  • The limitations of JARs and bundles for packaging large applications
  • How enterprise OSGi applications can be packaged as a single unit
  • Other solutions to the OSGi application packaging problem
  • How to package your sample application as a single deployable unit

Over the past couple of chapters you’ve put together an application consisting of a number of application bundles. As the number of bundles increased, it’s quickly become unmanageable when you try to deploy it. Even with only a simple web frontend and the persisted backend that you added in the last chapter, the application has seven bundles to remember to install. It’s time to look at how you can package your application in a more convenient form.

Packaging an application has changed over time, in much the same way as writing an application has. Originally programs were small, and could easily be packaged as a single binary file. As programs grew in complexity, they also grew in size and were split into a number of discrete units, usually based on function. As Java developers, you’ll already be familiar with the concept of a JAR file and should also understand the structure of an OSGi bundle.

4.1. The need for more than modules

4.2. Enterprise OSGi subsystems

4.3. The Enterprise Bundle Archive (EBA)

4.4. Alternative approaches

4.5. Developing an enterprise OSGi application

4.6. Summary