OPS4J
  Pax Swissbox - Extender
Added by Alin Dreghiciu, last edited by Alin Dreghiciu on Feb 09, 2008  (view change)

Labels

 
Overview

As Peter Kriens defines "The extender pattern allows other bundles to extend the functionality in a specific domain.". (read more about on OSGi Alliance blog and Peter Kriens blog)
Some projects that make use of this pattern are Pax Web Extender and Spring DM Extender.

The Pax Swissbox - Extender is meant for those that need to implement an extender bundle and want to archive this in easy way.

How do I make use of it?

As an extender bundle implementor you will have to:

  1. Implement your custom BundleObserver (what do you want to archive with the extender)
  2. Create and start a BundleWatcher, specifying the desired BundleScanner

How does it work?

The BundleWatcher will watch for bundle life cycle events by using a synchronous bundle listener. As soon as a bundle gets started (and all previous started bundles), the BundleWatcher will inspect the bundle using the specified BundleScanner. If the BundleScanner will return any entry it will call the addingEntries on your custom BundleObserver passing along the bundle and the found entries. As a bundle gets stopped and if that bundle generated any entry during the scanning process, the removingEntries on your custom BundleObserver will be called.
It's up to you as an extender bundle developer, what you do with the entries found.

Bundle Scanners

Bundle scanners role is to process a starting bundle for specific type of artifacts such as for example specific files or specific entries in MANIFEST.MF. As an extender bundle developer you can develop one of your own but there are built in bundle scanners that covers most of the common use cases such as:

  • BundleURLScanner — scans for specific directory or files.
  • BundleManifestScanner — scans a bundle manifest (META-INF/MANIFEST.MF) for specific entries (starting with version 0.2.0).

Examples

For examples check out built in bundle scanners.

Issue tracker

Issues, bugs, and feature requests can be submitted to the issue tracking system.

Usage

System requirements

  • any OSGI R4 compilant framework

Manual installation

Pax Runner installation

pax-run mvn:org.ops4j.pax.swissbox/pax-swissbox-extender

Maven dependency

<dependency>
  <groupId>org.ops4j.pax.swissbox</groupId>
  <artifactId>pax-swissbox-extender</artifactId>
  <version>0.2.0</version>
</dependency>

Source code

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

Latest News

Pax Swissbox 0.2.0 has been released.
This release highlights are:

  • bug fixes related to bundle class loader
  • new extender scanner for scanning manifest files
  • url extender scanner can now be configured also by using manifest entries

Checkout release notes for details.

Posted at Feb 23, 2008 by Alin Dreghiciu | 0 comments