From 1b109eca6bc86296551c705feb247ca7a8e55978 Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 18 Aug 2010 15:21:24 +0000 Subject: TUSCANY-3653 - Add slots to store information read from JAXWS annotations. This information will be read by a util (that will eventually be reused by the implementation.java code) and processed by the processor. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@986735 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/interfacedef/java/JavaInterface.java | 45 ++++++++++++++++++++++ .../interfacedef/java/impl/JavaInterfaceImpl.java | 37 +++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) (limited to 'sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache') diff --git a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java index 8edd94bc56..e042d863d7 100644 --- a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java +++ b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.interfacedef.java; import javax.xml.namespace.QName; import org.apache.tuscany.sca.assembly.Base; +import org.apache.tuscany.sca.contribution.Contribution; import org.apache.tuscany.sca.interfacedef.Interface; /** @@ -86,4 +87,48 @@ public interface JavaInterface extends Interface, Base { * @param callbackClass the callback class specified in an @Callback annotation */ void setCallbackClass(Class callbackClass); + + /** + * A Java interface may have JAXWS annotations that refer to a + * a WSDL document. The resulting WSDL location is stored here + * so that is can be resolved after the Java interface itself + * has been resolved + * + * @return WSDL interface + */ + String getJAXWSWSDLLocation(); + + /** + * A Java interface may have JAXWS annotations that refer to a + * a WSDL document. The resulting WSDL location is stored here + * so that is can be resolved after the Java interface itself + * has been resolved + * + * @param wsdlInterface + */ + void setJAXWSWSDLLocation(String wsdlLocation); + + /** + * A Java interface may have JAXWS annotations that refer to a + * a Java interface by name. The resulting class name is stored here + * so that is can be resolved after this Java interface + * has been resolved + * + * @return + */ + String getJAXWSJavaInterfaceName(); + + /** + * A Java interface may have JAXWS annotations that refer to a + * a Java interface by name. The resulting class name is stored here + * so that is can be resolved after this Java interface + * has been resolved + * + * @return + */ + void setJAXWSJavaInterfaceName(String javaInterfaceName); + + public Contribution getContributionContainingClass(); + + public void setContributionContainingClass(Contribution contributionContainingClass); } diff --git a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java index 54946a9413..a217f3ea0c 100644 --- a/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java +++ b/sca-java-2.x/trunk/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java @@ -28,6 +28,7 @@ import java.lang.reflect.ParameterizedType; import javax.xml.namespace.QName; import org.apache.tuscany.sca.assembly.xml.Constants; +import org.apache.tuscany.sca.contribution.Contribution; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; @@ -50,6 +51,9 @@ public class JavaInterfaceImpl extends InterfaceImpl implements JavaInterface { private WeakReference> javaClass; private Class callbackClass; private QName qname; + private String jaxwsWSDLLocation; + private String jaxwsJavaInterfaceName; + private Contribution contributionContainingClass; protected JavaInterfaceImpl() { super(); @@ -321,5 +325,36 @@ public class JavaInterfaceImpl extends InterfaceImpl implements JavaInterface { } // end for return false; } // end method isAsyncServer - + + public String getJAXWSWSDLLocation() { + return jaxwsWSDLLocation; + } + + public void setJAXWSWSDLLocation(String wsdlLocation) { + this.jaxwsWSDLLocation = wsdlLocation; + } + + public String getJAXWSJavaInterfaceName() { + return jaxwsJavaInterfaceName; + } + + public void setJAXWSJavaInterfaceName(String javaInterfaceName) { + this.jaxwsJavaInterfaceName = javaInterfaceName; + } + + /** + * 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 remember the actual contribution that + * was used to resolve a Java class. + * + * @return + */ + public Contribution getContributionContainingClass() { + return contributionContainingClass; + } + + public void setContributionContainingClass(Contribution contributionContainingClass) { + this.contributionContainingClass = contributionContainingClass; + } } -- cgit v1.2.3