LibraryLink ToToggle FramesPrintFeedback

XML Repositories

The provisioning component in the FUSE ESB Kernel provides simple, yet flexible, ways to provision libraries or applications. They can be downloaded locally, installed, and started, using Maven artifacts, URLs, and local file paths. Different URL handlers are provided for installing and deploying features.

A feature consists of one or more OSGi bundles grouped to collectively provide a specific feature or functionality. Provisioning allows you to install complex applications by installing multiple related OSGi bundles in the FUSE ESB container. Each feature is made up of a collection of bundles that work together to provide some functionality. When a feature is loaded, the container loads any required bundles that are not already present into the container and activates them.

Features allow you to load a collection of bundles using a single name. Using an XML deployment descriptor, you can collectively deploy/undeploy a set of bundles and recursively a set of features.

The provisioning system uses XML repositories that define a set of features. An XML repository uses a XML features descriptor. Each descriptor defines one or more feature elements, each one representing an application that can be installed.

A feature is identified by its name, which must be unique among all the repositories used and consists of a set of bundles that must be installed, along with optional dependencies on other features and optional configurations for the Configuration Admin OSGi service. (See Configuration Admin OSGi compendium service.)

The XML repository schema uses Relax NG, a schema language for XML, based on RELAX and TREX. The XML repositories use the following Relax NG Compact syntax in the repository schema:

The following example has one feature:

The following example has two features:

The most important information provided by a feature is the set of OSGi bundles that defines an application. You specify URLs that point to the actual bundle JARs. For example, if you specify the following, this bundle will be installed when installing the feature:

FUSE ESB Kernel provides several URL handlers in addition to the usual ones like file and HTTP. One of these is the Maven URL handler, which allows you to reuse Maven repositories to point to the bundles.

The Maven equivalent of the previous bundle is:

In addition to being less verbose, Maven URL handlers can resolve snapshots and use a local copy of the JAR if one is available in your local Maven repository.

The org.ops4j.pax.url.mvn bundle resolves Maven URLs. You can configure this flexible tool using the configuration service.

For example, to find the current repositories:

The repositories checked are controlled by these configuration properties.

For example, org.ops4j.pax.url.mvn.repositories is a comma separated list of repository URLs specifying the remote repositories to be checked.

To replace the defaults with a new repository at http://www.example.org/repo on the local system:

Snapshots are disabled by default. To enable a URL for snapshots, append @snapshots, for example:

http://www.example.org/repo@snapshots

Repositories on the local system are supported using file:/ URLs.

Dependent features are useful when a particular feature depends on another feature that must be installed. You specify the dependency in the feature definition:

<feature name="jbi">
   <feature>nmr</feature>
   ...
<feature>

Because of this dependency, the required nmr feature is automatically installed when the jbi feature is installed.

The following example shows how to specify dependencies between features. Installing the web feature requires that the web-core. feature is installed.

The configuration section allows you to deploy configuration for the OSGi Configuration Admin service along with a set of bundles. The following is an example of such a configuration:

<config name="com.foo.bar">
   myProperty = myValue
</config>

The name attribute of the configuration element is used as the PID for the configuration set in the Configuration Admin service. When using a ManagedServiceFactory, the name attribute is servicePid-aliasId, where servicePid is the PID of the ManagedServiceFactory and aliasId is a label used to uniquely identify a particular service (an alias to the factory generated service PID)

Deploying this configuration has the same effect as dropping a file named com.foo.bar.cfg in the \etc directory of your installation.

The content of the configuration element is a set of properties parsed using the standard Java property mechanism.

This configuration is usually used with Spring-DM support for the Configuration Admin service, as in the following example:

<bean ...>
    <property name="propertyName" value="${myProperty}" />
 </bean>     
            
 <osgix:cm-properties id="cmProps" persistent-id="com.foo.bar">
    <prop key="myProperty">myValue</prop>
 </osgix:cm-properties>
 <ctx:property-placeholder properties-ref="cmProps" />

You can also use plain OSGi APIs.

For more information on using the Configuration Admin service in Spring-DM, see the Spring-DM documentation. (Also see OSGi Compendium services.)

There is a simple configuration file in your install directory, /etc/org.apache.servicemix.features.cfg, which contains:

This configuration file has two properties:

You can modify this file to customize the behavior when starting FUSE ESB Kernel for the first time. You can also modify this configuration file if you plan to distribute FUSE ESB Kernel with pre-installed features.