Search in sources :

Example 1 with ProvisionResourceHeader

use of org.apache.aries.subsystem.core.archive.ProvisionResourceHeader in project aries by apache.

the class BasicSubsystem method computeDependenciesPostInstallation.

void computeDependenciesPostInstallation(Coordination coordination) throws IOException {
    resource.computeDependencies(null, coordination);
    ProvisionResourceHeader header = resource.computeProvisionResourceHeader();
    setDeploymentManifest(new DeploymentManifest.Builder().manifest(deploymentManifest).header(header).build());
}
Also used : ProvisionResourceHeader(org.apache.aries.subsystem.core.archive.ProvisionResourceHeader)

Example 2 with ProvisionResourceHeader

use of org.apache.aries.subsystem.core.archive.ProvisionResourceHeader in project aries by apache.

the class SubsystemResource method computeDependencies.

void computeDependencies(DeploymentManifest manifest, Coordination coordination) {
    if (manifest == null) {
        computeDependencies(getSubsystemManifest(), coordination);
    } else {
        ProvisionResourceHeader header = manifest.getProvisionResourceHeader();
        if (header == null)
            return;
        for (ProvisionResourceHeader.Clause clause : header.getClauses()) {
            Resource resource = findDependency(clause);
            if (resource == null)
                throw new SubsystemException("A required dependency could not be found. This means the resource was either missing or not recognized as a supported resource format due to, for example, an invalid bundle manifest or blueprint XML file. Turn on debug logging for more information. The resource was: " + resource);
            addDependency(resource);
        }
    }
}
Also used : ProvisionResourceHeader(org.apache.aries.subsystem.core.archive.ProvisionResourceHeader) SubsystemException(org.osgi.service.subsystem.SubsystemException) Resource(org.osgi.resource.Resource)

Example 3 with ProvisionResourceHeader

use of org.apache.aries.subsystem.core.archive.ProvisionResourceHeader in project aries by apache.

the class Utils method isDependency.

public static boolean isDependency(BasicSubsystem subsystem, Resource resource) {
    DeploymentManifest manifest = subsystem.getDeploymentManifest();
    if (manifest == null)
        return false;
    ProvisionResourceHeader header = manifest.getProvisionResourceHeader();
    if (header == null)
        return false;
    return header.contains(resource);
}
Also used : DeploymentManifest(org.apache.aries.subsystem.core.archive.DeploymentManifest) ProvisionResourceHeader(org.apache.aries.subsystem.core.archive.ProvisionResourceHeader)

Aggregations

ProvisionResourceHeader (org.apache.aries.subsystem.core.archive.ProvisionResourceHeader)3 DeploymentManifest (org.apache.aries.subsystem.core.archive.DeploymentManifest)1 Resource (org.osgi.resource.Resource)1 SubsystemException (org.osgi.service.subsystem.SubsystemException)1