ApacheCon Europe 2012

Rhein-Neckar-Arena, Sinsheim, Germany

5–8 November 2012

Scripting languages in OSGi

Frank Lyaruu

Audience level:
Intermediate
Track:
Modular Java Applications

Thursday 12:30 p.m.–1:15 p.m. in Rhein-Neckar

Description

In a perfect world you can pick any language you like to attack a certain problem, and you can freely add all those languages to a system and they all play nice together. This is not reality, but not as far fetched as it may seem. By generating OSGi bundles on the fly and utilizing Java's scripting support we can build systems that are stable, flexible and scalable.

Abstract

When solving a problem, we want to have as much freedom as possible to pick the best tools for the job, but at architectural levels, we do like things to be structured and as simple as possible.

In this presentation we'll discuss how we can use OSGi to have our cake and eat it: Have the flexibility we want while having well defined building blocks.

We will focus on how to reach the following goals: - Leverage OSGi's dependency injection within scripts - Support both interpreted languages and compiled languages - Edit, compile and (re)deploy at runtime

To be more concrete:

  • Compiling on the fly: Java Compilers within OSGi
  • Detecting compile time dependencies
  • Generating bundles: Manifests, dependencies, and Declarative Service headers
  • Runtime compilation and provisioning
  • Provisioning with Apache Ace*