tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1043311 - /tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
Date Wed, 08 Dec 2010 05:47:28 GMT
Author: lresende
Date: Wed Dec  8 05:47:27 2010
New Revision: 1043311

URL: http://svn.apache.org/viewvc?rev=1043311&view=rev
Log:
Fixing minor issue when running regular resolution path (side effect of previous change)

Modified:
    tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java?rev=1043311&r1=1043310&r2=1043311&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-widget/src/main/java/org/apache/tuscany/sca/implementation/widget/WidgetImplementationProcessor.java
Wed Dec  8 05:47:27 2010
@@ -105,12 +105,12 @@ public class WidgetImplementationProcess
 
     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 WidgetImplementationProcess
 
                         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 {



Mime
View raw message