tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r665984 - in /incubator/tuscany/java/sca/modules/interface-wsdl: pom.xml src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
Date Tue, 10 Jun 2008 05:35:04 GMT
Author: lresende
Date: Mon Jun  9 22:35:03 2008
New Revision: 665984

URL: http://svn.apache.org/viewvc?rev=665984&view=rev
Log:
Adding support for introspecting endConversation extension attribute in wsdl interfaces definitions

Modified:
    incubator/tuscany/java/sca/modules/interface-wsdl/pom.xml
    incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java

Modified: incubator/tuscany/java/sca/modules/interface-wsdl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/pom.xml?rev=665984&r1=665983&r2=665984&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/pom.xml Mon Jun  9 22:35:03 2008
@@ -48,6 +48,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-policy</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+        </dependency>        
+
+        <dependency>
             <groupId>org.apache.ws.commons.schema</groupId>
             <artifactId>XmlSchema</artifactId>
             <version>1.3.2</version>

Modified: incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java?rev=665984&r1=665983&r2=665984&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceIntrospectorImpl.java
Mon Jun  9 22:35:03 2008
@@ -29,6 +29,7 @@
 
 import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.interfacedef.ConversationSequence;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
@@ -44,6 +45,7 @@
 public class WSDLInterfaceIntrospectorImpl {
     private static final QName POLICY_REQUIRES = new QName("http://www.osoa.org/xmlns/sca/1.0",
"requires");
     private static final QName POLICY_CONVERSATIONAL = new QName("http://www.osoa.org/xmlns/sca/1.0",
"conversational");
+    public static final QName POLICY_END_CONVERSATION = new QName("http://www.osoa.org/xmlns/sca/1.0",
"endsConversation");
     
     private XSDFactory xsdFactory;
     private PolicyFactory policyFactory;
@@ -58,7 +60,11 @@
         List<Operation> operations = new ArrayList<Operation>();
         for (Object o : portType.getOperations()) {
             javax.wsdl.Operation wsdlOp = (javax.wsdl.Operation)o;
-            operations.add(getOperation(wsdlOp, wsdlDefinition, resolver, xsdFactory));
+            Operation operation = getOperation(wsdlOp, wsdlDefinition, resolver, xsdFactory);
+            if(isEndConversation(wsdlOp)) {
+                operation.setConversationSequence(ConversationSequence.CONVERSATION_END);
+            }
+            operations.add(operation);
         }
         return operations;
     }
@@ -119,5 +125,17 @@
 
         return conversational;
     }
+
+    private boolean isEndConversation(javax.wsdl.Operation operation) {
+        boolean endConversation = false;
+        
+        Object o =  operation.getExtensionAttribute(POLICY_END_CONVERSATION);
+        if(o != null && o instanceof String) {
+            endConversation = Boolean.valueOf((String)o);            
+        }
+
+        return endConversation;
+        
+    }
     
 }



Mime
View raw message