You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2010/08/18 17:10:28 UTC

svn commit: r986727 - /tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java

Author: slaws
Date: Wed Aug 18 15:10:28 2010
New Revision: 986727

URL: http://svn.apache.org/viewvc?rev=986727&view=rev
Log:
TUSCANY-3653 - Add a slot to store the contribution that was used to resolve the class that the class reference points to. This is used when WSDL files, that the Class may point to via JAXWS @WebService or @WebServiceProvider annotations need to be resolved within the same contribution that holds the Java class. What we maybe could do is have a better model of Java class, and a related processor, that is able to look for annotations and do the resolution at the time the Java class is resolved. 

Modified:
    tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java

Modified: tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java?rev=986727&r1=986726&r2=986727&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java Wed Aug 18 15:10:28 2010
@@ -22,6 +22,7 @@ package org.apache.tuscany.sca.contribut
 import java.lang.ref.WeakReference;
 
 import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.contribution.Contribution;
 
 /**
  * A weak reference to a class, which should be used to register classes
@@ -37,6 +38,7 @@ public class ClassReference implements B
     
     private WeakReference<Class<?>> clazz;
     private String className;
+    private Contribution contributionContainingClass;
 
     /**
      * Constructs a new ClassReference.
@@ -104,5 +106,24 @@ public class ClassReference implements B
             }
         }
     }
+    
+    /**
+     * A Java class may reference a WSDL file via a JAXWS annotation. We need to resolve
+     * the WSDL file location in the context of the same contribution that holds the 
+     * Java file. In order to do this we need to pass back the actual contribution that
+     * was used to resolve a Java class. It's possible that multiple contributions hold
+     * the same class so just scanning the artifacts in all the contribution is not good 
+     * enough
+     * 
+     * @return
+     */
+    public Contribution getContributionContainingClass() {
+        return contributionContainingClass;
+    }
+    
+    public void setContributionContainingClass(
+            Contribution contributionContainingClass) {
+        this.contributionContainingClass = contributionContainingClass;
+    }
 
 }