Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Provisioning

Thomas Diesler edited this page May 26, 2014 · 6 revisions

Container Provisioning

The Provisioner is aware of the target Environment, has access to a resource Repository and uses a Resolver to provision the needed Resources to provide the Capabilities that satisfy the provisioning Requirements. In short, given a set of requirements, the provisioner adds resources to the target container to satisfy those requirements.

Many of the concepts and initial implementations come from former OSGi R5 work. Where in fact we provided the reference implementation for the R5 Repository service.

Ultimately, the Provisioner deploys Resources, which become Modules, in the Container Runtime. For details please have a look at the dedicated page on Deployment.

Here is an example that provisions the abstract camel core feature.

// Provision the camel.core feature
ResourceIdentity identity = ResourceIdentity.fromString("camel.core.feature:0.0.0");
Requirement req = new IdentityRequirementBuilder(identity).getRequirement();
Set<ResourceHandle> result = provisioner.provisionResources(Collections.singleton(req));

try {
    // do stuff
} finally {
    for (ResourceHandle handle : handles) {
       handle.uninstall();
    }
}

The individual resource definitions are part of the Repository content, which can be provided remotely or as part of the Fabric8 distribution. Details of transitive dependency chains, container specific formats and resource ordering are all dealt with by the provisioner.

Before any Resource gets deployed to the target container, the Provisioner does a no-impact analysis to find out whether the given requirements can actually be satisfied with the available Repository content and the given runtime state of the target container.

Clone this wiki locally