tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject svn commit: r1607329 - in /tomee/tomee/branches/tomee-1.7.x: ./ container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
Date Wed, 02 Jul 2014 11:55:30 GMT
Author: andygumbrecht
Date: Wed Jul  2 11:55:30 2014
New Revision: 1607329

URL: http://svn.apache.org/r1607329
Log:
Merged revision(s) 1607311-1607328 from tomee/tomee/trunk:
reading @MTOM
........
PMD
........

Modified:
    tomee/tomee/branches/tomee-1.7.x/   (props changed)
    tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
    tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java

Propchange: tomee/tomee/branches/tomee-1.7.x/
------------------------------------------------------------------------------
  Merged /tomee/tomee/trunk:r1607311-1607328

Modified: tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java?rev=1607329&r1=1607328&r2=1607329&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
(original)
+++ tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WebModule.java
Wed Jul  2 11:55:30 2014
@@ -101,7 +101,7 @@ public class WebModule extends Module im
             webApp.setContextRoot(contextRoot);
         }
 
-        host = SystemInstance.get().getProperty(id.getName() + ".host", (String) null);
+        host = SystemInstance.get().getProperty(id.getName() + ".host", null);
     }
 
     @Override

Modified: tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java?rev=1607329&r1=1607328&r2=1607329&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
(original)
+++ tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/config/WsDeployer.java
Wed Jul  2 11:55:30 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(final Class<?> clazz, final 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();
@@ -251,7 +265,7 @@ public class WsDeployer implements Dynam
 
         final Map<String, EjbDeployment> deploymentsByEjbName = ejbModule.getOpenejbJar().getDeploymentsByEjbName();
 
-        WebserviceDescription webserviceDescription = null;
+        WebserviceDescription webserviceDescription;
         for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans())
{
             // skip if this is not a webservices endpoint
             if (!(enterpriseBean instanceof SessionBean)) {
@@ -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);
@@ -389,8 +404,7 @@ public class WsDeployer implements Dynam
 
         final Object object = module.getAltDDs().get(wsdlFile);
         if (object instanceof Definition) {
-            final Definition definition = (Definition) object;
-            return definition;
+            return (Definition) object;
         }
 
         try {



Mime
View raw message