use of org.apache.aries.subsystem.core.archive.SubsystemContentHeader in project aries by apache.
the class ResolveContext method isValid.
private boolean isValid(Capability capability, Requirement requirement) throws BundleException, IOException, InvalidSyntaxException, URISyntaxException {
if (IdentityNamespace.IDENTITY_NAMESPACE.equals(capability.getNamespace()))
return true;
Resource provider = capability.getResource();
Resource requirer = requirement.getResource();
SubsystemManifest manifest = resource.getSubsystemManifest();
SubsystemContentHeader header = manifest.getSubsystemContentHeader();
if (header.contains(provider) && header.contains(requirer)) {
// are in the same region and the capability will be visible.
return true;
}
Region from = findRegionForCapabilityValidation(provider);
Region to = findRegionForCapabilityValidation(requirer);
return new SharingPolicyValidator(from, to).isValid(capability);
}
use of org.apache.aries.subsystem.core.archive.SubsystemContentHeader in project aries by apache.
the class Utils method isContent.
/*
* The Deployed-Content header in the deployment manifest is used to store
* information about explicitly installed resources and provisioned
* dependencies in addition to content for persistence purposes. This method
* returns true only if the resource is "true" content of the subsystem and,
* therefore, uses the Subsystem-Content header from the subsystem manifest.
*/
public static boolean isContent(BasicSubsystem subsystem, Resource resource) {
SubsystemManifest subsystemManifest = subsystem.getSubsystemManifest();
if (subsystemManifest == null)
return false;
SubsystemContentHeader subsystemContentHeader = subsystemManifest.getSubsystemContentHeader();
if (subsystemContentHeader == null)
return false;
return subsystemContentHeader.contains(resource);
}
use of org.apache.aries.subsystem.core.archive.SubsystemContentHeader in project aries by apache.
the class SubsystemResource method addDependencies.
private void addDependencies(Resource resource, Map.Entry<Resource, List<Wire>> entry, Map<Resource, List<Wire>> resolution) {
String type = ResourceHelper.getTypeAttribute(resource);
SubsystemContentHeader contentHeader = getSubsystemManifest().getSubsystemContentHeader();
if (// Do not include synthetic resources as dependencies.
!Constants.ResourceTypeSynthesized.equals(type) && !contentHeader.contains(resource)) {
// Do not include content as dependencies.
addDependency(resource);
}
}
Aggregations