From 809fc112853dbc527ac7dd0d29a6caf0abe0cfd5 Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Wed, 5 Aug 2009 12:32:13 +0000 Subject: Add Contribution context information to Monitor during Resolve phase git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@801178 13f79535-47bb-0310-9956-ffa450edef68 --- .../impl/ContributionContentProcessor.java | 54 ++++++++++++---------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'java/sca/modules') diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java index 4e075fea24..d651393e78 100644 --- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java +++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/ContributionContentProcessor.java @@ -215,30 +215,36 @@ public class ContributionContentProcessor implements ExtendedURLArtifactProcesso public void resolve(Contribution contribution, ModelResolver resolver) throws ContributionResolveException { - if( !preResolved ) preResolve( contribution, resolver); - ModelResolver contributionResolver = contribution.getModelResolver(); - - // Resolve all artifact models - for (Artifact artifact : contribution.getArtifacts()) { - Object model = artifact.getModel(); - if (model != null) { - try { - artifactProcessor.resolve(model, contributionResolver); - } catch (Throwable e) { - throw new ContributionResolveException(e); - } - } - } - - // Resolve deployable composites - List deployables = contribution.getDeployables(); - for (int i = 0, n = deployables.size(); i < n; i++) { - Composite deployable = deployables.get(i); - Composite resolved = (Composite)contributionResolver.resolveModel(Composite.class, deployable); - if (resolved != deployable) { - deployables.set(i, resolved); - } - } // end for + try { + monitor.pushContext("Contribution: " + contribution.getURI()); + + if( !preResolved ) preResolve( contribution, resolver); + ModelResolver contributionResolver = contribution.getModelResolver(); + + // Resolve all artifact models + for (Artifact artifact : contribution.getArtifacts()) { + Object model = artifact.getModel(); + if (model != null) { + try { + artifactProcessor.resolve(model, contributionResolver); + } catch (Throwable e) { + throw new ContributionResolveException(e); + } + } + } + + // Resolve deployable composites + List deployables = contribution.getDeployables(); + for (int i = 0, n = deployables.size(); i < n; i++) { + Composite deployable = deployables.get(i); + Composite resolved = (Composite)contributionResolver.resolveModel(Composite.class, deployable); + if (resolved != deployable) { + deployables.set(i, resolved); + } + } // end for + } finally { + monitor.popContext(); + } // end try } // end method resolve /** -- cgit v1.2.3