Coordinator coordinator = coordSvcRef != null ? (Coordinator) bc.getService(coordSvcRef) : null;
Coordination coordination = coordinator != null ? coordinator.begin(ResolveOperation.class.getName(), 0) : null;
// Begin resolve
ResolveProcess resolve = new ResolveProcess();
ResolverLogger logger = new ResolverLogger();
try {
BndResolver bndResolver = new BndResolver(logger);
//
// Make sure we do macro expansion properly
//
File resource = model.getBndResource();
if (model.isProjectFile()) {
Project project = Central.getProject(resource.getParentFile());
//
// run's in projects are based on the project
// and implicitly the ws
//
model.setProject(project);
} else {
//
// run's in bndrun files are the bndrun + workspace
//
Run run = new Run(Central.getWorkspace(), resource.getParentFile(), resource);
model.setProject(run);
}
ReporterLogService log = new ReporterLogService(Central.getWorkspace());
Map<Resource,List<Wire>> wirings = resolve.resolveRequired(model, Central.getWorkspace(), bndResolver, callbacks, log);
result = new ResolutionResult(Outcome.Resolved, wirings, null, status, logger.getLog());
if (coordination != null)
coordination.end();
} catch (ResolveCancelledException e) {
result = new ResolutionResult(Outcome.Cancelled, null, null, status, logger.getLog());
if (coordination != null)
coordination.fail(e);
} catch (ResolutionException e) {
status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, e.getLocalizedMessage(), e));
result = new ResolutionResult(Outcome.Unresolved, null, e, status, logger.getLog());
if (coordination != null)
coordination.fail(e);
} catch (Exception e) {
status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Exception during resolution.", e));
result = new ResolutionResult(Outcome.Error, null, null, status, logger.getLog());
if (coordination != null)
coordination.fail(e);
} finally {
if (coordinator != null)