tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1607311 - /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
Date Wed, 02 Jul 2014 11:15:42 GMT
Author: rmannibucau
Date: Wed Jul  2 11:15:42 2014
New Revision: 1607311

URL: http://svn.apache.org/r1607311
Log:
reading @MTOM

Modified:
    tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java

Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java?rev=1607311&r1=1607310&r2=1607311&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
(original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
Wed Jul  2 11:15:42 2014
@@ -49,6 +49,7 @@ import javax.wsdl.extensions.soap.SOAPAd
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
 import javax.xml.namespace.QName;
+import javax.xml.ws.soap.MTOM;
 import javax.xml.ws.soap.SOAPBinding;
 import java.io.File;
 import java.io.IOException;
@@ -216,6 +217,7 @@ public class WsDeployer implements Dynam
                     if (portComponent.getProtocolBinding() == null) {
                         portComponent.setProtocolBinding(JaxWsUtils.getBindingUriFromAnn(clazz));
                     }
+                    configMtomAnnotation(clazz, portComponent);
                     if (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding())
||
                             SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding()))
{
                         portComponent.setEnableMtom(true);
@@ -234,6 +236,18 @@ public class WsDeployer implements Dynam
         }
     }
 
+    private void configMtomAnnotation(Class<?> clazz, PortComponent portComponent)
{
+        final MTOM mtom = clazz.getAnnotation(MTOM.class);
+        if (mtom != null) {
+            if (portComponent.getEnableMtom() == null) {
+                portComponent.setEnableMtom(mtom.enabled());
+            }
+            if (portComponent.getMtomThreshold() == null) {
+                portComponent.setMtomThreshold(mtom.threshold());
+            }
+        }
+    }
+
     private void processPorts(final EjbModule ejbModule) throws OpenEJBException {
         // map existing webservice port declarations by servlet link
         Webservices webservices = ejbModule.getWebservices();
@@ -324,6 +338,7 @@ public class WsDeployer implements Dynam
                 if (portComponent.getProtocolBinding() == null) {
                     portComponent.setProtocolBinding(JaxWsUtils.getBindingUriFromAnn(ejbClass));
                 }
+                configMtomAnnotation(ejbClass, portComponent);
                 if (SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding())
||
                         SOAPBinding.SOAP11HTTP_MTOM_BINDING.equals(portComponent.getProtocolBinding()))
{
                     portComponent.setEnableMtom(true);



Mime
View raw message