summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-08-18 15:10:28 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-08-18 15:10:28 +0000
commitbbcf6ca60b233580a44b07779c890b2328a7bbb5 (patch)
treec02f8328271f280c0418cb67eb47fd435762a1ae /sca-java-2.x/trunk/modules
parent38f1b7fd933297f67a5bb2fb03c64821b8edbc90 (diff)
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.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@986727 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
index fa91784a1b..7d8f2ef1c8 100644
--- a/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
+++ b/sca-java-2.x/trunk/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java
@@ -22,6 +22,7 @@ package org.apache.tuscany.sca.contribution.resolver;
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 Base {
private WeakReference<Class<?>> clazz;
private String className;
+ private Contribution contributionContainingClass;
/**
* Constructs a new ClassReference.
@@ -104,5 +106,24 @@ public class ClassReference implements Base {
}
}
}
+
+ /**
+ * 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;
+ }
}