Composite composite = ArtifactsFinder.findComposite(compositeURI,
artifacts);
boolean found = false;
if (composite == null)
throw new CompositeUpdaterException(
"Composite not found in contribution" + contribURI);
else {
processor.setComposite(composite);
try {
processor.read(c.build());
} catch (Exception e) {
throw new CompositeUpdaterException(
"Component error parsing in contribution" + contribURI);
}
found = true;
}
if (found) {
Component component = processor.getParsedComponent();
Composite augmentedComposite = processor.getParsedComposite();
try {
processor.resolve(component, contrib.getModelResolver());
compositeBuilder.attach(augmentedComposite, component);
((CompositeActivatorImpl) compositeActivator)
.activateComponent(component);
} catch (Exception e) {
throw new CompositeUpdaterException(
"Cannot activate the component");
}
return component;
}