Skip to content

Services

the-ricker edited this page Jan 6, 2012 · 3 revisions

This page describes the OSGi services provided in the Bundle Builder project.

Design

Interchangeable services

The objective is to make the components completely interchangeable. The bundles provide default implementations of the services, but others can register other implementations that meet their particular needs.

Job pattern

The services related to building can be long running and parallel. The services follow a common pattern. The services themselves are much like factory classes. The services have a main method that returns a callable class. This callable can then be placed on a Java executor service.

Primary services

The following are the primary services provided in the Bundle Builder project. Each has an implementation provided. In true OSGi spirit, there is no dependency on the implementations provided. Others can create their own implementations.

Resolver

com.jeffreyricker.osgi.resolver.BundleResolver

The resolver service resolves the dependencies of bundles. Every OSGi implementation needs a resolver and has one, but it is not a standard OSGi service. None of the implementations provide the resolver as a standalone service. A resolver is useful for many purposes, not just for building or for the runtime container. We hope that OSGi will make a formal service, but until then we have provided our own.

The resolver implementation is based on SAT4J.

Builder

com.jeffreyricker.osgi.builder.BundleBuilder

The builder service is the primary service that brings all the parts together and does the work. It depends on the resolver, compiler and packager.

Compiler

com.jeffreyricker.osgi.compiler.BundleCompiler

The bundle compiler service compiles the Java source files into classes using the resolver service to resolve the class path.

Packager

com.jeffreyricker.osgi.packager.BundlePackager

The bundle packager service packages the compiled Java classes and the other necessary files into a bundle jar file.

Source

com.jeffreyricker.osgi.source.BundleSourceFactory

The bundle source factory service creates a bundle source from a given file directory. Source factories enable different project layouts and project metadata. This project provides an Eclipse implementation.

Other services

Repository

We use the OSGi Bundle Repository service API.

Logging

Logging is a critical part of the build process. We use the OSGi log service which enables the greatest flexibility of hooking in the specific logging needed for the deployment environment.