use of org.apache.aries.subsystem.core.archive.DeploymentManifest in project aries by apache.
the class BasicSubsystem method removedContent.
void removedContent(Resource resource) {
DeploymentManifest manifest = getDeploymentManifest();
DeployedContentHeader header = manifest.getDeployedContentHeader();
if (header == null)
return;
DeployedContentHeader.Clause clause = header.getClause(resource);
if (clause == null)
return;
removedContent(Collections.singleton(clause));
}
use of org.apache.aries.subsystem.core.archive.DeploymentManifest in project aries by apache.
the class BasicSubsystem method removedContent.
synchronized void removedContent(Collection<DeployedContentHeader.Clause> content) {
DeploymentManifest manifest = getDeploymentManifest();
DeployedContentHeader header = manifest.getDeployedContentHeader();
if (header == null)
return;
Collection<DeployedContentHeader.Clause> clauses = new ArrayList<DeployedContentHeader.Clause>(header.getClauses());
for (Iterator<DeployedContentHeader.Clause> i = clauses.iterator(); i.hasNext(); ) if (content.contains(i.next())) {
i.remove();
break;
}
DeploymentManifest.Builder builder = new DeploymentManifest.Builder();
for (Entry<String, Header<?>> entry : manifest.getHeaders().entrySet()) {
if (DeployedContentHeader.NAME.equals(entry.getKey()))
continue;
builder.header(entry.getValue());
}
if (!clauses.isEmpty())
builder.header(new DeployedContentHeader(clauses));
try {
setDeploymentManifest(builder.build());
} catch (Exception e) {
throw new SubsystemException(e);
}
}
use of org.apache.aries.subsystem.core.archive.DeploymentManifest in project aries by apache.
the class BasicSubsystem method getDeploymentManifestHeaderValue.
private String getDeploymentManifestHeaderValue(String name) {
DeploymentManifest manifest = getDeploymentManifest();
if (manifest == null)
return null;
Header<?> header = manifest.getHeaders().get(name);
if (header == null)
return null;
return header.getValue();
}
use of org.apache.aries.subsystem.core.archive.DeploymentManifest 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);
}
Aggregations