summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-12-08 05:47:27 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-12-08 05:47:27 +0000
commit68b75835263a6f8bebb74f0aa2731fb4c6ae4044 (patch)
tree01183ac762f0351901d52f916233b5f648d19bf0
parentab5e85568fbb24bc9412afd79854892cb067bdd8 (diff)
Fixing minor issue when running regular resolution path (side effect of previous change)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1043311 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java32
1 files changed, 21 insertions, 11 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java b/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
index 39e6ae0606..b5b374baad 100644
--- a/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
@@ -105,12 +105,12 @@ public class WidgetImplementationProcessor extends BaseStAXArtifactProcessor imp
public void resolve(WidgetImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
- if (implementation != null) {
- // Resolve the resource directory location
+ if (implementation != null) {
+ // Resolve the resource directory location
Artifact artifact = contributionFactory.createArtifact();
artifact.setURI(implementation.getLocation());
Artifact resolved = resolver.resolveModel(Artifact.class, artifact, context);
-
+
if(resolved.getLocation() == null) {
URL resource = null;
URI uri = URI.create(implementation.getLocation());
@@ -134,24 +134,34 @@ public class WidgetImplementationProcessor extends BaseStAXArtifactProcessor imp
implementation.setLocationURL(resource);
- //introspect implementation
- WidgetImplementationIntrospector widgetIntrospector =
- new WidgetImplementationIntrospector(registry, implementation);
- widgetIntrospector.introspectImplementation();
-
- implementation.setUnresolved(false);
} catch (MalformedURLException e) {
ContributionResolveException ce = new ContributionResolveException(e);
error(context.getMonitor(), "ContributionResolveException", resolver, ce);
}
}
+ } else {
+ try {
+ implementation.setLocationURL(new URL(resolved.getLocation()));
+ } catch (MalformedURLException e) {
+ ContributionResolveException ce = new ContributionResolveException(e);
+ error(context.getMonitor(), "ContributionResolveException", resolver, ce);
+ }
}
-
+
+ //introspect implementation
+ WidgetImplementationIntrospector widgetIntrospector =
+ new WidgetImplementationIntrospector(registry, implementation);
+ widgetIntrospector.introspectImplementation();
+
+ implementation.setUnresolved(false);
+
+
+
if (implementation.isUnresolved()) {
error(context.getMonitor(), "CouldNotResolveLocation", resolver, implementation.getLocation());
//throw new ContributionResolveException("Could not resolve implementation.widget location: " + implementation.getLocation());
}
- }
+ }
}
public void write(WidgetImplementation implementation, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {