summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/implementation-java
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-10-18 15:30:34 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-10-18 15:30:34 +0000
commitf608a1a1a45191102c60533ad42983ac11ffc454 (patch)
tree08d36501b0093910e3bb1184aaf1f6a10aeba5d1 /sca-java-2.x/trunk/modules/implementation-java
parent8dfd45378ae01a6152ba75745baf3b6794b5b4ed (diff)
POJO_8037 Add an intent based on @BindingType annotation
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1023851 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-java')
-rw-r--r--sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java44
1 files changed, 36 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
index d97d375a0d..50bb5f86d3 100644
--- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
+++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JAXWSProcessor.java
@@ -20,12 +20,12 @@ package org.apache.tuscany.sca.implementation.java.introspect.impl;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.Iterator;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceProvider;
@@ -41,12 +41,9 @@ import org.apache.tuscany.sca.implementation.java.IntrospectionException;
import org.apache.tuscany.sca.implementation.java.JavaImplementation;
import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaOperation;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
@@ -194,20 +191,51 @@ public class JAXWSProcessor extends BaseJavaClassVisitor {
addSOAPIntent(service);
}
hasJaxwsAnnotation = true;
- }
+ }
- if (hasJaxwsAnnotation == true){
+
+ // Process @BindingType annotation - POJO_8037
+ BindingType bindingType = clazz.getAnnotation(BindingType.class);
+
+ if ( bindingType != null ) {
+ String bindingTypeValue = bindingType.value();
+ for ( Service service : type.getServices() ) {
+ addBindingTypeIntent(service, bindingTypeValue);
+ }
+ hasJaxwsAnnotation = true;
+ }
+
+ if (hasJaxwsAnnotation == true){
// Note that services are based on JAXWS annotations in case
// we need to know later. Add a ws binding and a JAXWS annotation
// implies a WS binding
for ( Service service : type.getServices() ) {
service.setJAXWSService(true);
- createWSBinding(type, service);
+ createWSBinding(type, service);
}
}
+
+
+
}
- /**
+ private void addBindingTypeIntent(PolicySubject subject,
+ String bindingTypeValue) {
+
+ Intent soapIntent = policyFactory.createIntent();
+ if ( javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING.equals(bindingTypeValue)) {
+ soapIntent.setName(Constants.SOAP11_INTENT);
+ } else if ( javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING.equals(bindingTypeValue)) {
+ soapIntent.setName(Constants.SOAP12_INTENT);
+ } else {
+ soapIntent.setName(Constants.SOAP11_INTENT);
+ }
+
+ subject.getRequiredIntents().add(soapIntent);
+
+ }
+
+ /**
* Utility methods
*/