Java Reference
In-Depth Information
Figure 9.12
The manifests for
NetBeans OSGi bundles allow
variable substitution. The editor
doesn't have autocompletion or
error detection.
Despite the similarities between
OSG
i bundles
and NetBeans modules, NetBeans'
OSG
i support
is limited. Developing
OSG
i bundles in NetBeans
is like doing code-first development, except
instead of the code, NetBeans is guided by its proj-
ect.xml file. For example, private packages are
shown with a cute little padlock decorator, but this
information is stored in the project file. Depen-
dencies are also always per-module (or, equiva-
lently, per-bundle) rather than
OSG
i's preferred
package-level dependencies (see figures 9.12
and 9.13).
Figure 9.13
When you add a module ex-
plicitly to one of your NetBeans modules,
it shows in the Libraries twisty of the mod-
ule. This is similar to the plug-in depen-
dencies twisty in Eclipse, and Eclipse's
referenced libraries twisty.
9.2.2
Osmorc and IntelliJ IDEA
Recent premium versions of the IntelliJ
IDEA
IDE
bundle a set of
OSG
i tools called
Osmorc. Osmorc is also available independently as a plug-in to IntelliJ's Community
Edition. One nice feature of Osmorc is that it supports both a manifest-first and a
code-first approach to
OSG
i development. Existing manifests can be used to generate
module dependencies, and manifests can also be generated from project bytecode.
Like many
OSG
i tools, Osmorc embeds bnd for the manifest generation support.
What's an Osmorc?
If you're curious what
Osmorc
stands for, it's
OSGi Module Layer and Eclipse RCP Sup-
port
. The second part of the name has to do with another of Osmorc's features, the
ability to run applications based on the Eclipse Rich Client Platform GUI framework
inside IDEA. It doesn't have anything to do with the Eclipse IDE (confusingly!).
Figure 9.14 shows what the
fancyfoods
application looks like when edited with IntelliJ
IDEA
.
Like Eclipse
PDE
and bndtools, Osmorc allows you to set up a compile-time and
runtime environment, called a
framework instance
.







