Realdolmen Education

Details

OSGi

This course is currently not scheduled on the open calendar, but can be organized on request.

Request Course

Duration

4 day(s)

Audience

Java developers interested in gaining a thorough understanding of OSGi and how to use it to build highly modular, extensible applications

Prerequisites

Being a competent Java developer or hands-on architect and having a good understanding of core Java. Some experience with using a build tool such as ANT and an IDE such as Eclipse will be useful but not essential.

Objectives

At the end of the course, participants will have an excellent grasp of OSGi technology, from the fundamentals through to advanced and enterprise topics.

Methods

Classroom training with hands-on exercises, 40% labs and exercises, 60% presentation

Description

While Java is a very powerful and flexible platform, one thing that Java misses is a built-in system for modularization of software components. This is a problem for enterprises, who typically need to deal with versioning, updates and deployment of software components. Traditional solutions for these problems are custom-built, expensive and not portable.

OSGi solves this problem by introducing a mature component system that reduces operational costs and integrates easily with the networking environment. With OSGi, it becomes possible to deploy, start, stop, update and administer software bundles containing critical business services without having to reboot. During this course you how learn how to leverage OSGi in your business to make a difference.

		We will start by explaining the very basics of OSGi, and progressively work towards more advanced subjects. On day one, you will be introduced to OSGi and learn how it meets the challenge of building modular, scalable application architectures for the Java Platform. We will review the three principal open source implementations and then dive into the construction of modules, learning how to define dependencies between them and manage versions of APIs. Next we’ll move onto OSGi Services, the lynchpin of OSGi’s programming model and the key to creating flexible, reusable components. You will use the Declarative Services (DS) specification to build components that react to their environment, configure themselves dynamically and interact with other components. Then we will look at one of the most important patterns used in constructing real applications using services, namely the “Whiteboard Pattern”.
		


		On day two, we return to practical topics such as how to build and test modules using industry-standard tools such as ANT, Maven, JUnit and Hudson/Jenkins. Also we will cover how to define and manage a runtime application using combinations of modules and configurations, and how to correctly evolve APIs and implementations over time. We conclude with a review of alternative component models including Blueprint and Apache Felix iPOJO.
		


		During the third day of the course, we explore the full module lifecycle, how to safely update modules at runtime, and how the lifecycle affects services. We will discuss another common and useful OSGi pattern known as the “Extender Pattern”, examine examples of existing extenders such as the Eclipse extension registry, and build our own extender. Next we will look at the Compendium of useful services offered by the OSGi specification, and also some useful third-party modules and tools.
		


		The last day of the course, focuses on enterprise topics. We cover distributed programming with Remote Services (Distributed OSGi or D-OSGi), including how to manage discovery and topology in a network containing a large number of nodes. Next we will build a RESTful web service based on standard JAX-RS technology with OSGi, and look at all the options for deploying web applications, including embedding an OSGi framework inside a Java EE application server or web container (e.g. Tomcat). We finish by exploring OSGi interoperability with Java EE specifications including JNDI, JTA, JPA and JDBC.
		


		At the end of the course, participants will have a solid foundation of skill and understanding that will allow them to use OSGi in the most efficient way possible. Throughout the course there will also be many exercises, so that the acquired skills can be put into practice.

Contents

  • Introduction

    • What is modularity?
    • Java Modularity and JAR Hell
    • OSGi Bundles
    • Tooling
    • Open Source Implementations
  • Services

    • Introduction to Services
    • Declarative Services
    • Component Lifecycle
    • References to Services
    • Laziness
    • Configuring Components
    • Whiteboard Pattern
  • OSGi in Practice

    • Building bundles with Bnd
    • Other tools: Eclipse, Maven, Unit Testing
    • Configuring Runtimes
    • Evolving APIs
    • Semantic Versioning
    • Other component models: Blueprint, iPojo
  • Lifecycle

    • Bundle Lifecycle
    • Bundle Events
    • Concurrency and Thread Safety
    • Extender Bundles
  • OSGi Compendium

    • Event Admin
    • Configuration Admin
    • HTTP Service
    • Coordinator Service
  • Enterprise

    • Remote Services
    • REST and OSGi
    • Web Application Bundles
    • Embedding OSGi
    • Bridging OSGi to EJB
    • Transaction with JTA
  • Optional Topics

    • OSGi Sub-systems
    • OSGi Future Directions
    • JDK 8 Module System and how it will affect OSGi
    • Other JVM languages in OSGi