|
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:
- Implement your custom BundleObserver (what do you want to archive with the extender)
- 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:
Examples
For examples check out built in bundle scanners.
Issue tracker
Issues, bugs, and feature requests can be submitted to the issue tracking system.
|