What's new in Karaf 2.2.4 ?
Apache Karaf 2.2.4 has been released this week end.
You can take a look on the release notes.
More than a bug fixes release, this version includes several new features and enhancements.
Command aliases
Previously, the osgi:* commands gathered different kind of usage: osgi:start, osgi:stop, etc are related to bundles, osgi:shutdown is related to container itself, and osgi:ls is OSGi service related.
To be clearer for the users, new aliases have been introduced.
NB: on Karaf trunk (future 3.0.0 release), the commands have been fully renamed (not aliased).
system:*
The system:* commands are related to the Karaf container itself:
-
system:shutdownis equivalent toosgi:shutdownand shutdown the Karaf container -
system:start-levelis equivalent toosgi:start-leveland defines the default start-level to consider bundles as system bundles
services:*
The services:* commands are related to OSGi services:
services:listis equivalent tolsand lists the OSGi services available
bundles:*
The bundles:* commands are related to OSGi bundles:
bundles:listis equivalent toosgi:listand lists the OSGi bundlesbundles:installis equivalent toosgi:installand installs OSGi bundlesbundles:uninstallis equivalent toosgi:uninstalland uninstalls OSGi bundlesbundles:startis equivalent toosgi:startand starts OSGi bundlesbundles:stopis equivalent toosgi:stopand stops OSGi bundlesbundles:headeris equivalent toosgi:headersand displays OSGi bundles headersbundles:infois equivalent toosgi:infoand displays bundle.info filebundles:refreshis equivalent toosgi:refreshand refresh OSGi bundlesbundles:resolveis equivalent toosgi:resolveand resolves OSGi bundlesbundles:restartis equivalent toosgi:restartand restarts OSGi bundlesbundles:start-levelis equivalent toosgi:start-leveland defines the OSGi bundles start levelbundles:updateis equivalent toosgi:updateand updates OSGi bundles
New MBeans
To be able to monitor and administrate with your own tool (Nagios, Apache Kalumet, your own JMX client), Karaf now provides a set of new MBeans.
Bundles MBean
The bundles MBean (org.apache.karaf:type=bundles) allows you to view and change the bundles. As with bundles:* shell commands, you can select bundles using bundle ID (for instance 20), bundle ID range (for instance 21-25 means bundle ID 21, 22, 23, 24, 25), bundle name and version including support of regex (for instance mybunde, mybundle/version, myb*).
list()operation gives your a tabular view about all bundles deployed, including the ID, the location, and the current status of the bundlegetStartLevel()andsetStartLevel()allows you to get/set the start level of bundlesrefresh()allows to refresh bundlesupdate()allows to update bundlesresolve()allows to resolve bundlesrestart()allows to restart bundlesinstall()installs bundles from an URL. The URL could be a “classic” one (file: or http:), a Maven URL (mvn:), an OBR URL (obr:)start()starts bundlesstop()stops bundlesuninstall()uninstalls bundles
Config MBean
The config MBean (org.apache.karaf:type=config) allows you to view and change the OSGi configuration (ConfigAdmin layer). As with config:* shell commands, the changes are flushed into the /etc configuration file.
list()gives you all configuration PID present in the Karaf containercreate()creates a new configuration PIDdelete()deletes a configuration PIDproplist()list properties for a given configuration PIDpropdel()deletes a property from a given configuration PIDpropappend()appends content to a property in the given configuration PIDpropset()set/add a property in the given configuration PID
Dev MBean
The dev MBean (org.apache.karaf:type=dev) allows you view the OSGi framework in use and set the framework options:
framework()gives the current OSGi framework in use (Felix or Equinox)frameworkOptions()allows you to define OSGi framework options (debug mode, framework to use)restart()allows you to restart the Karaf container
Log MBean
The log MBean (org.apache.karaf:type=log) allows you to view/change the log level currently used (globally or for a given logger):
set()sets the log level to use (for the root logger, or for a given logger)get()gives the log level in use (for the root logger, or for a given logger)
OBR MBean
The OBR MBean (org.apache.karaf:type=obr) allows you to manipulate the OBR client:
listUrls()list the OBR server URL (containing the repository.xml file) register in the Karaf OBRaddUrl()adds a new OBR server in the OBR clientremoveUrl()removes an OBR server from the OBR clientrefreshUrl()updates the OBR information in the OBR clientlist()lists the bundles available via the OBR clientdeploy()deploys a bundle (and its dependency bundles) from the OBR
Packages MBean
The packages MBean (org.apache.karaf:type=packages) allows you to get information about exported and imported packages (and the related bundles):
exportedPackageslists the exported package (globally or for a given bundle)importedPackageslists the imported package (globally or for a given bundle)
Services MBean
The services MBean (org.apache.karaf:type=services) allows you to view the OSGi services available:
list()lists the OSGi services available (globally, or only one in use, or provided by a given bundle)
System MBean
The system MBean (org.apache.karaf:type=system) allows you to manipulate the Karaf container itself:
shutdown()shutdown the Karaf container
Web MBean
The web MBean (org.apache.karaf:type=web) allows you to see the web bundles (web application) available:
list()gives you a tabular view of all web application deployed in Karaf (including the bundle and the context path)
Better KAR support
A KAR (Karaf ARchive) artifact is a zip file containing a feature XML descriptor and related bundles jar.
In previous Karaf version, we had issue with the Kar support. In Karaf 2.2.4:
- the features Maven plugin provides a goal to create a KAR. Simply use a the
create-kargoal with a feature.xml and you will have a ready to deploy KAR in the target directory - the KAR deployer was not able to correctly uncompress the KAR zip entries, it’s now fixed
- the KAR deployer now automatically starts all features containing in a KAR file. It means that simply by dropping the KAR file in the deploy folder, Karaf will uncompress the KAR file, correctly creating a Karaf local repository for the KAR, and start all features containing in the KAR shipped feature XML
Spring features
To avoid Spring versions mismatch in others projects (such as Apache Camel, CXF, or ServiceMix), Karaf now provides a large set of Spring features:
- spring
- spring-web
- spring-aspects
- spring-dm
- spring-dm-web
- spring-instrument
- spring-jdbc
- spring-jms
- spring-struts
- spring-test
- spring-orm
- spring-oxm
- spring-tx
- spring-web
- spring-web-portlet
It allows others projects to directly use these features (with a version range), and so, be less coupled to a Spring version.
Others
Some others minors things have been added:
- the
dev:watchcommand now supports multiple bundle as argument - the wrapper service provides a lib for Linux 64 bits platform
- the J2SE-1.6 and J2SE-1.7 execution environment have been added
obr:deployshell command now supports a-soption to automatically start bundles- Karaf JMX service could be configured to use SSL now
system:shutdownshell command displays the instance name (for confirmation)
Comments
Post a Comment