O'Reilly logo

Building Modular Cloud Apps with OSGi by Paul Bakker, Bert Ertman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Deployment

Now that we have seen how to design and build modular applications, we should also know how to actually deploy them to production systems. This book is about building modular cloud apps, so the focus of this chapter will be on deploying to the cloud. We will see, however, that we can use the exact same approach to deploy to in-house servers and even to other types of devices.

Understanding OSGi Runtimes

So far we have been running our code directly from Bndtools, and we have seen a simple example of launching an OSGi container manually from code. How does this apply to production deployments? First we should understand what an OSGi runtime actually is. An OSGi container is the layer on top of the JVM that understands the concept of bundles and implements all the rules and features defined in the OSGi Core Specification. OSGi containers are in general extremely lightweight and are also often used in environments with very constrained resources. In a pure OSGi environment, you might run a bare-bones OSGi container as your deployment platform directly. This works very well, and we will discuss this extensively in this chapter.

An OSGi container can also be embedded in other kinds of server products such as Java EE application servers or even as part of an application. After discussing our preferred deployment model, we will discuss these alternatives.

Choosing an OSGi Framework for Deployment

In all the examples in the book, we have been using Apache Felix. There ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required