}
URL contributionURL = uri.toURL();
// Load the contribution
logger.log(quietLogging? Level.FINE : Level.INFO, "Loading contribution: " + contributionURL);
Contribution contribution = deployer.loadContribution(contributionURI, contributionURL, context.getMonitor());
contributions.add(contribution);
boolean attached = false;
for (DeploymentComposite dc : contrib.getDeploymentComposites()) {
if (dc.getContent() != null) {
Reader xml = new StringReader(dc.getContent());
attached = attachDeploymentComposite(contribution, xml, null, attached, context);
} else if (dc.getLocation() != null) {
URI dcURI = createURI(dc.getLocation());
if (!dcURI.isAbsolute()) {
Composite composite = null;
// The location is pointing to an artifact within the contribution
for (Artifact a : contribution.getArtifacts()) {
if (dcURI.toString().equals(a.getURI())) {
composite = (Composite)a.getModel();
if (!attached) {
contribution.getDeployables().clear();
attached = true;
}
contribution.getDeployables().add(composite);
break;
}
}
if (composite == null) {
// Not found
throw new ServiceRuntimeException("Deployment composite " + dcURI
+ " cannot be found within contribution "
+ contribution.getLocation());
}
} else {
URL url = dcURI.toURL();
InputStream is = openStream(url);
Reader xml = new InputStreamReader(is, "UTF-8");