tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r827983 - in /tuscany/branches/sca-java-1.x: itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/ itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/ modules/implementation-jee/src/main/java/o...
Date Wed, 21 Oct 2009 12:16:21 GMT
Author: slaws
Date: Wed Oct 21 12:16:20 2009
New Revision: 827983

URL: http://svn.apache.org/viewvc?rev=827983&view=rev
Log:
TUSCANY-3347 make the name of the implementation.jee composite unique

Modified:
    tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/helloworld.composite
    tuscany/branches/sca-java-1.x/itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/TestExternalEarModelResolver.java
    tuscany/branches/sca-java-1.x/modules/implementation-jee/src/main/java/org/apache/tuscany/sca/implementation/jee/xml/JEEImplementationProcessor.java

Modified: tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/helloworld.composite?rev=827983&r1=827982&r2=827983&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/helloworld.composite
(original)
+++ tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/scajar-ear-appcomp/src/main/resources/helloworld.composite
Wed Oct 21 12:16:20 2009
@@ -29,7 +29,7 @@
     </component>
 
     <component name="HelloworldServiceComponent">
-        <implementation.jee archive="itest-contribution-jee-samples-29-ear-appcomp-contrib-implicit.ear"/>
+        <implementation.jee archive="./itest-contribution-jee-samples-29-ear-appcomp-contrib-implicit.ear"/>
         <reference name="JavaReference" target="HelloworldTargetComponent"/>
     </component>
     

Modified: tuscany/branches/sca-java-1.x/itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/TestExternalEarModelResolver.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/TestExternalEarModelResolver.java?rev=827983&r1=827982&r2=827983&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/TestExternalEarModelResolver.java
(original)
+++ tuscany/branches/sca-java-1.x/itest/contribution-jee/src/main/java/org/apache/tuscany/sca/test/contribution/jee/TestExternalEarModelResolver.java
Wed Oct 21 12:16:20 2009
@@ -91,7 +91,7 @@
                     URL earLocation = null;
                     if ( uri.toString().equals("itest-contribution-jee-samples-13-ear-nonenhanced.ear")){
                      
                         earLocation = new File("../contribution-jee-samples/ear-nonenhanced/target/itest-contribution-jee-samples-13-ear-nonenhanced.ear").toURL();
-                    } else if ( uri.toString().equals("itest-contribution-jee-samples-29-ear-appcomp-contrib-implicit.ear")){
                      
+                    } else if ( uri.toString().equals("./itest-contribution-jee-samples-29-ear-appcomp-contrib-implicit.ear")){
                      
                         earLocation = new File("../contribution-jee-samples/ear-appcomp-contrib-implicit/target/itest-contribution-jee-samples-29-ear-appcomp-contrib-implicit.ear").toURL();
                     } else if ( uri.toString().equals("itest-contribution-jee-samples-30-ear-appcomp-contrib-implicit-war-appcomp.ear")){
                      
                         earLocation = new File("../contribution-jee-samples/ear-appcomp-contrib-implicit-war-appcomp/target/itest-contribution-jee-samples-30-ear-appcomp-contrib-implicit-war-appcomp.ear").toURL();
                       

Modified: tuscany/branches/sca-java-1.x/modules/implementation-jee/src/main/java/org/apache/tuscany/sca/implementation/jee/xml/JEEImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-jee/src/main/java/org/apache/tuscany/sca/implementation/jee/xml/JEEImplementationProcessor.java?rev=827983&r1=827982&r2=827983&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/implementation-jee/src/main/java/org/apache/tuscany/sca/implementation/jee/xml/JEEImplementationProcessor.java
(original)
+++ tuscany/branches/sca-java-1.x/modules/implementation-jee/src/main/java/org/apache/tuscany/sca/implementation/jee/xml/JEEImplementationProcessor.java
Wed Oct 21 12:16:20 2009
@@ -106,8 +106,6 @@
         JEEImplementation implementation = implementationFactory.createJEEImplementation();
         implementation.setUnresolved(true);
         
-        implementation.setName(IMPLEMENTATION_JEE);
-
         // Read the archive attribute
         String archive = getString(reader, "archive");
         if (archive != null) {
@@ -116,6 +114,25 @@
             // Set the URI of the component type 
             implementation.setURI(archive);
         }
+        
+        // the resulting implementation (composite) will be cached by the CompositeModelResolver
+        // based on it's name so we need to derive a unique name for this implementation
based
+        // on the name of the archive that it represents
+        String path = URI.create(archive).getPath();
+        String localName = "impl-jee-current-dir-archive";
+        if (path != null){
+            int s = path.lastIndexOf('/');
+            if (s > -1){
+                localName = path.substring(s + 1);
+            } else {
+                if (path.length() > 0 && !path.equals(".")){
+                    localName = path;
+                }   
+            }
+        } 
+        
+        QName name = new QName(Constants.SCA10_TUSCANY_NS, localName);
+        implementation.setName(name);
 
         // Read policies
         policyProcessor.readPolicies(implementation, reader);



Mime
View raw message