Search in sources :

Example 1 with RequireCapabilityRequirement

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

the class SubsystemResource method setImportIsolationPolicy.

private void setImportIsolationPolicy(RegionFilterBuilder builder, RequireCapabilityHeader header) throws InvalidSyntaxException {
    if (header == null)
        return;
    for (RequireCapabilityHeader.Clause clause : header.getClauses()) {
        RequireCapabilityRequirement requirement = new RequireCapabilityRequirement(clause, this);
        String policy = requirement.getNamespace();
        String filter = requirement.getDirectives().get(RequireCapabilityRequirement.DIRECTIVE_FILTER);
        if (filter == null)
            // A null filter directive means the requirement matches any
            // capability from the same namespace.
            builder.allowAll(policy);
        else
            // Otherwise, the capabilities must be filtered accordingly.
            builder.allow(policy, filter);
    }
}
Also used : RequireCapabilityRequirement(org.apache.aries.subsystem.core.archive.RequireCapabilityRequirement) RequireCapabilityHeader(org.apache.aries.subsystem.core.archive.RequireCapabilityHeader)

Aggregations

RequireCapabilityHeader (org.apache.aries.subsystem.core.archive.RequireCapabilityHeader)1 RequireCapabilityRequirement (org.apache.aries.subsystem.core.archive.RequireCapabilityRequirement)1