NetBeans Module System and OSGi are kind of similar. They provide a way to write modular applications. They encode their metadata in MANIFEST.MF, etc. This page has been created to host the "alignment" effort to allow NetBeans Platform 6.9 to reuse and execute OSGi bundles next to native NetBeans modules. This would allow NetBeans to benefit from existing packaged bundles available elsewhere. See live demo screencast to understand the possibilities this project opens.
- Explanation of the implementation decisions
- Mailing list - subscribe, view archives, etc.
- Repository with sources
- Builds made daily
- Small tutorials Bundle Activators
- Lookup and registerService
Plan, Status & ToDo list
There are few different directions that this project can span. Not all of them need to be implemented. Some may be implemented partially, some not at all. Here is the list of currently known areas.
There will be one new module core.netigso part of NetBeans platform 6.9. This module will provide the bridge between NetBeans module system and OSGi bundles by plugging into NetBeans Runtime Container and by embedding Felix to handle the OSGi bundles (alternative containers may be supported elsewhere).
There is an excellent 1:1 mapping provided by Richard Hall, yet it is bit too complex due to the attempt to support implementation dependencies. This is not really needed in the dual system which has both containers running in parallel. If one needs implementation dependency one can write NetBeans modules. If one wants OSGi, then one can depend just on public exported packages. As such the actual mapping is simplified:
- : Extend Felix to eliminate current use of reflection (0days of work, convince Richard Hall to integrate FELIX-1991 the patch)
- Lookup.getDefault() exposes what is registered via BundleContext.registerService(...)
- Expose in BundleContext.getServides what is in Lookup.getDefault()
- , 3hours, jtulach: BundleActivator.stop is never called
Development via Ant
- Automate creation of OSGi clusters:
ant -f $NETIGSO/harness/suite.xml clusterize -Dcluster=`pwd` -Dincludes=modules/**
- I can import the cluster, See the module, Set a dependency on it from another module
- 42efcb3cdfa5: UI for clusterizing set of bundles
- 8e15557466f2, jtulach: Modules can now be only in direct subdirectory under the cluster - allow them to be anywhere under the cluster
- Verify by importing GlassFish and Eclipse bundles
The current apisupport harness has been extended to allow generation of both NetBeans as well as OSGi modules/bundles. Each project has its own manifest.mf file. In case there is OpenIDE-Module tag, the build injects NetBeans metadata into the final JAR's manifest. In case the previous tag is missing, and there is Bundle-SymbolicName tag, the OSGi like dependencies are injected instead. This allows people to easily switch between both systems with just a single line change in the manifest.mf file.
- Ant tasks enhancements: JarWithModuleAttributes
Picture taken from RcpDevelWithBridgedOSGi.
Development via Maven
No need for special handling of OSGi bundles. There exist plugins that support creation of OSGi JARs. However we need to fix the final plugin that packages the NetBeans based application to allow proper reuse of OSGi bundles from Maven repositories:
More info about the diagram is available at RcpDevelWithBridgedOSGi.
- : Eliminate implementation dependencies in platform issue #179289
- : Create an OSGi extender module to:
- Make sure Lookup.getDefault() sees all META-INF/services
- Make sure FileUtil.getConfigRoot() sees all layers
- Make sure ModuleInstall methods are called properly
More info at NetBeansInOSGi page.
One of the goal of the OSGiAndNetBeans project is to benefit from reusing other technologies in OSGi form. The show case is supposed to be Mylyn used via OSGi. This has been implemented in NetBeans 7.1.