concept Karaf in category osgi

appears as: Karaf, Karaf
Enterprise OSGi in Action

This is an excerpt from Manning's book Enterprise OSGi in Action.

An alternative to Pax Runner, with slightly more dynamic provisioning behavior, is Apache Karaf. Like the name implies, Karaf is a little OSGi container. Karaf has some handy features that are missing in Pax Runner, like hot deployment and runtime provisioning. This functionality makes Karaf suitable for use as a production runtime, rather than as a test container. Karaf is so suitable for production, it underpins the Apache Geronimo server. But Karaf isn’t as well integrated into existing unit test frameworks as Pax Runner, so if you use Karaf for your testing you’ll mostly be limited to the “use JUnit to scrape test result logs” approach we described above.

Karaf has a lot of support for Apache Aries, which makes it a convenient environment for developing and testing enterprise OSGi applications. So well integrated is Karaf with Aries, Karaf comes with Blueprint support by default. Even better, if you list the OSGi bundles using the osgi:list, there’s a special column that shows each bundle’s Blueprint status.

If you prefer to use a GUI console, you can install the optional web console into Karaf using the command features:install webconsole. Because of OSGi’s dynamism, as soon as the console feature is installed, the web console will be available. If you miss the command line, the web console even embeds a version of the shell. Sadly, the one thing absent from the web console is the shell’s Blueprint status list.

Karaf is a nice integration framework, with many handy extensions to what you get if you run a plain OSGi framework like Felix or Equinox. We like the console and the integrated Blueprint support. But Karaf isn’t an application server; even if you add in lots of Karaf features, it won’t do all the things an application server does.

13.2.1. Karaf features

One of Karaf’s headline functions is known as Karaf features. A Karaf feature is an XML file that describes a set of bundles that can be installed into a Karaf runtime. (You may recall seeing Karaf features before, in section 8.3.4.) Karaf ships preconfigured with a repository with many useful feature definitions, and new feature repositories can easily be added.

Figure 13.1. To see the features Karaf can install, use the features:list command.