+

Search Tips   |   Advanced Search

Auto-provisioning a feature

Auto-provisioning allows a feature to have dependencies on features that must be provisioned, before it can be provisioned.

An auto-provisioned feature is a feature that has dependencies on other features. Because of the dependencies, the lifecycle of the auto-provisioned feature is as follows:

To configure a feature to be auto-provisioned, follow these steps:

  1. Determine which features should be provisioned before the runtime automatically provisions this feature.

  2. Add the IBM-Provision-Capability to the manifest header. The format of the IBM-Provision-Capability header uses standard OSGi LDAP filters.

  3. Deploy the feature to the server.


Results

The feature automatically provisions when the required features have been provisioned.


Example

In the following example, if features requiredFeature1-1.0 and requiredFeature2-1.0 are provisioned, this feature will be automatically provisioned. If either of these required features are removed from server.xml, this feature will be automatically de-provisioned.

IBM-Provision-Capability: osgi.identity; filter:="(&(type=osgi.subsystem.feature)(osgi.identity= requiredFeature1-1.0))", osgi.identity; filter:="(&(type=osgi.subsystem.feature)(osgi.identity= requiredFeature2-1.0))"


Parent topic: Develop a Liberty feature manually

Tasks:

  • Work with the OSGi service registry

    Reference:

  • Liberty feature manifest files