OPS4J
  Scanner - OBR
Added by Alin Dreghiciu, last edited by Alin Dreghiciu on Feb 04, 2008  (view change)

Labels

 

OBR Scanner makes use of Apache Felix OBR implementation.
At the moment the current OBR implementation (1.0.0) is not 100% "production ready".
Also there are few OBR repositories and some of them have incomplete or malformed content.

Overview

The OBR scanner handles a set of bundles listed in plain text file(s) by its symbolic name and an optional version. The scaner will first use OBR to discover and resolve any requirements the listed bundles have.

How does it work

The OBR scanner will parse the provided url and transform the content in OBR valid filters. As OBR makes use of the current available bundles (to satisfy requirements) a prior to framework start resolving process cannot be performed. To overcome this OBR scanner will add two bundles to the list of bundles to be installed:

  • Apache Felix Bundle Repository — OBR implementation used to discover and install resolved bundles
  • Pax Runner OBR Script — uses OBR to discover the bundles that match the prior parsed obr filters.

As the target framework gets started the Pax Runner OBR Script bundle will perform its duty as soon as OBR service become available.

Syntax

scan-obr:file_url[@start_level][@nostart][@update]

where:

  • file_url : mandatory; is the url of the file containing the list of bundles to be installed;
  • start_level : optional; an integer representing the start level of the bundles present in the pom.
    If present and OSGi Start Level Service is available then the bundle is installed with that specific start level.
    This option overwrites the startLevel configuration property;
  • nostart : optional; this should be the hardcoded string "nostart" (not case sensitive).
    If present the bundles will not be started.
    This option overwrites the start configuration property;
  • update : optional; the hardcoded string "update" (not case sensitive)
    If present the bundles will be updated.
    This option overwrites the update configuration property;

The above options: start_level/nostart/update can be specified in any order.

Examples

File Format

Files containing bundles to be installed must be plain text files containing specifications of the bundles to be installed on separate line, one bundle per line and/or system properties. If system properties are present, those will be carried into the OSGi platform.
The syntax of an bundle reference is as follow:

symbolic_name[/version]

where:

  • symbolic_name : mandatory; is the bundle symbolic name (Bundle-SymbolicName manifest header) of the bundle to be installed.
  • version : optional; version (Bundle-Version manifest header) of the bundle to be installed. If not present and there are more bundles discovered with the same symbolic name, the one with the highest version number will be used.

The syntax of a property is as follow:

-Dproperty-name=property-value

where

  • property-name : the key of the property
  • property-value : the value of the property. The value can contain place holders as ${name} where name is the name of the property the ${name} placeholder will be replaced with.

The file can contain empty lines or lines starting with #, case when those lines will be skipped. This allows nice separation and comments.

File Examples
# install Eclipse Equinox Http Service implementation (the bundle will also be started on default start level)
org.eclipse.equinox.http

# install Eclipse Equinox Http Service implementation version 1.0.100.v20070423 (the bundle will also be started on default start level)
org.eclipse.equinox.http/1.0.100.v20070423

# properties for http service ports
-Dorg.osgi.service.http.port=2080
-Dorg.osgi.service.http.port.secure=2443

Configuration

The service can be configured in two ways: via configuration admin if available and via framework/system properties where the configuration via config admin has priority.

Option key Description
org.ops4j.pax.runner.scanner.obr.startlevel optional; default start level
org.ops4j.pax.runner.scanner.obr.start optional; true/false - if installed bundles should be started or not. Default value is true, so the bundles are started.
org.ops4j.pax.runner.scanner.obr.update optional; true/false - if installed bundles should be updated or not. Default value is false, so the bundles will not be updated.

Installation guide

This bundle is part of Pax Runner so if you are using pax runner you have nothing more to do about.
If you wanna use the bundle as a standalone bundle you could install it using the following methods:

Manual installation
Pax Runner installation

pax-run mvn:org.ops4j.pax.runner/pax-runner-scanner-obr

Source code

https://scm.ops4j.org/repos/ops4j/projects/pax/runner/pax-runner-scanner-obr ( or browse via FishEye )
This project builds with Apache Maven and uses Apache Felix's maven-bundle-plugin, and Peter Krien's bnd tool.

See also

Pax URL - classpath — classpath: protocol handler. Provides access to classpath resources from your bundle or other bundles installed.
Pax URL - ivy — ivy: protocol handler. Provides access to Ivy artifacts. (not implemented yet)
Pax URL - mvn — mvn: protocol handler. Provide access to maven repository artifacts based on the well known groupId, artifactId, version and type
PAX URL - obr — obr: protocol handler. Make use of OBR bundle repository.
Pax URL - war — war:/war-i: protocol handlers. Automates war deployment.
Pax URL - wrap — wrap: protocol handler. Wraps "classic" jars as OSGi bundles.
Platform - Concierge — Starts up Concierge OSGi framework
Platform - Equinox — Starts up Equinox OSGI framework
Platform - Extender — Installs platform services based via a whiteboard pattern
Platform - Felix — Starts up Felix OSGi framework
Platform - Knopflerfish — Starts up Knopflerfish OSGi framework
Scanner - Bundle — Installs a bundle specified as url.
Scanner - Directory — Install bundles available in a file system directory or zip
Scanner - File — Install bundles listed in a plain text file
Scanner - Maven 2 POM — Installs bundles listed as dependencies in a maven 2 pom.xml file
Scanner - OBR — Resolves and installs bundles references listed in a plain text file