use of org.apache.aries.subsystem.core.archive.SubsystemManifest in project aries by apache.
the class RawSubsystemResource method computeSubsystemManifestBeforeRequirements.
private SubsystemManifest computeSubsystemManifestBeforeRequirements(IDirectory content, SubsystemManifest manifest) throws MalformedURLException {
SubsystemManifest.Builder builder = new SubsystemManifest.Builder().manifest(manifest);
addSubsystemSymbolicNameHeader(builder, manifest);
addSubsystemVersionHeader(builder, manifest);
addSubsystemTypeHeader(builder, manifest);
addSubsystemContentHeader(builder, manifest);
builder.header(new GenericHeader(Constants.AriesSubsystemOriginalContent, String.valueOf(content.toURL())));
return builder.build();
}
use of org.apache.aries.subsystem.core.archive.SubsystemManifest in project aries by apache.
the class ResolveContext method isAcceptDependencies.
private boolean isAcceptDependencies() {
SubsystemManifest manifest = resource.getSubsystemManifest();
SubsystemTypeHeader header = manifest.getSubsystemTypeHeader();
ProvisionPolicyDirective directive = header.getProvisionPolicyDirective();
return directive.isAcceptDependencies();
}
use of org.apache.aries.subsystem.core.archive.SubsystemManifest in project aries by apache.
the class BasicSubsystem method wasInstalledWithChildrenHavingProvisionDependenciesResolve.
private static boolean wasInstalledWithChildrenHavingProvisionDependenciesResolve(Subsystem child) {
BasicSubsystem bs = (BasicSubsystem) child;
SubsystemManifest manifest = bs.getSubsystemManifest();
SubsystemTypeHeader header = manifest.getSubsystemTypeHeader();
AriesProvisionDependenciesDirective directive = header.getAriesProvisionDependenciesDirective();
if (directive.isResolve()) {
return true;
}
return wasInstalledWithChildrenHavingProvisionDependenciesResolve(child.getChildren());
}
use of org.apache.aries.subsystem.core.archive.SubsystemManifest in project aries by apache.
the class BasicSubsystem method getRequirements.
@Override
public List<Requirement> getRequirements(String namespace) {
// First, add the requirements from the manifest.
SubsystemManifest manifest = getSubsystemManifest();
List<Requirement> result = manifest.toRequirements(this);
if (namespace != null)
for (Iterator<Requirement> i = result.iterator(); i.hasNext(); ) if (!i.next().getNamespace().equals(namespace))
i.remove();
if (isScoped())
return result;
SubsystemContentHeader header = manifest.getSubsystemContentHeader();
for (Resource constituent : getConstituents()) if (header.contains(constituent))
for (Requirement requirement : constituent.getRequirements(namespace)) result.add(new BasicRequirement(requirement, this));
return result;
}
use of org.apache.aries.subsystem.core.archive.SubsystemManifest in project aries by apache.
the class BasicSubsystem method getCapabilities.
@Override
public List<Capability> getCapabilities(String namespace) {
// First, add the capabilities from the manifest.
SubsystemManifest manifest = getSubsystemManifest();
List<Capability> result = manifest.toCapabilities(this);
if (namespace != null)
for (Iterator<Capability> i = result.iterator(); i.hasNext(); ) if (!i.next().getNamespace().equals(namespace))
i.remove();
// in FeatureTest.testSharedContent() under certain conditions.
if (isScoped() || IdentityNamespace.IDENTITY_NAMESPACE.equals(namespace))
return result;
SubsystemContentHeader header = manifest.getSubsystemContentHeader();
for (Resource constituent : getConstituents()) {
if (header.contains(constituent)) {
for (Capability capability : constituent.getCapabilities(namespace)) {
if (namespace == null && (IdentityNamespace.IDENTITY_NAMESPACE.equals(capability.getNamespace()) || HostNamespace.HOST_NAMESPACE.equals(capability.getNamespace()))) {
// is null.
continue;
}
result.add(new BasicCapability(capability, this));
}
}
}
return result;
}
Aggregations