cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r451379 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/helpers/ common/common/src/test/java/org/apache/cxf/configuration/spring/ distribution/ distribution/src/main/xsl/ rt/bindings/soap/src/main/java/org/apache/cxf/b...
Date Fri, 29 Sep 2006 18:28:44 GMT
Author: dkulp
Date: Fri Sep 29 11:28:43 2006
New Revision: 451379

URL: http://svn.apache.org/viewvc?view=rev&rev=451379
Log:

Performance updates, fixes
* Update distribution to create a srcbuild_paths and such to allow running demos/perf tests
from source distro
* Update performance tests to remove "celtix"
* Update SOAP to make MTOM disabled the default (MTOM is a performance killer on smaller byte[],
also it should be off by default for jaxws)
* Update SoapMessage to make creation of the Header Element an "on demand" thing.  (don't
create if not needed)
* Update ReadHeadersInterceptor to only parse for headers if there is a soap:Header element
* Update StaxIn/Out to actually re-use the factories
* Update jaxws SOAPBindingImpl to properly allow turning on/off the MTOM support
* Update DOMUtils to re-use a DocumentBuilder when possible
* All in all, echoStruct goes from 160/sec(celtix) to 360/sec on my machine.   echoString
goes from 180(celtix) to 775/sec


Added:
    incubator/cxf/trunk/distribution/src/main/xsl/
    incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl   (with props)
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
    incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
    incubator/cxf/trunk/distribution/pom.xml
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/AttachmentDeserializer.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientServerMtomXopTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
    incubator/cxf/trunk/test/performance/README.txt
    incubator/cxf/trunk/test/performance/basic_type/bin/run_client
    incubator/cxf/trunk/test/performance/basic_type/bin/run_client.bat
    incubator/cxf/trunk/test/performance/basic_type/build.xml
    incubator/cxf/trunk/test/performance/complex_type/bin/run_client
    incubator/cxf/trunk/test/performance/complex_type/bin/run_client.bat
    incubator/cxf/trunk/test/performance/complex_type/build.xml
    incubator/cxf/trunk/test/performance/etc/common_build.xml

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java (original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/DOMUtils.java Fri
Sep 29 11:28:43 2006
@@ -50,9 +50,18 @@
  * @author Costin Manolache
  */
 public final class DOMUtils {
+    static final DocumentBuilderFactory FACTORY = DocumentBuilderFactory.newInstance();
+    static DocumentBuilder builder;
+
     private DOMUtils() {
     }
     
+    private static synchronized DocumentBuilder getBuilder() throws ParserConfigurationException
{
+        if (builder == null) {
+            builder = FACTORY.newDocumentBuilder();
+        }
+        return builder;
+    }
     /**
      * Get the trimed text content of a node or null if there is no text
      */
@@ -293,12 +302,16 @@
         t.transform(new DOMSource(n), new StreamResult(os));
     }
 
+    public static DocumentBuilder createDocumentBuilder() {
+        try {
+            return FACTORY.newDocumentBuilder();
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException("Couldn't find a DOM parser.", e);
+        }
+    }
     public static Document createDocument() {
         try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            DocumentBuilder b = factory.newDocumentBuilder();
-
-            return b.newDocument();
+            return getBuilder().newDocument();
         } catch (ParserConfigurationException e) {
             throw new RuntimeException("Couldn't find a DOM parser.", e);
         }

Modified: incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
(original)
+++ incubator/cxf/trunk/common/common/src/test/java/org/apache/cxf/configuration/spring/ConfigurerImplTest.java
Fri Sep 29 11:28:43 2006
@@ -157,6 +157,7 @@
         };
         assertEquals("a", configurer.getBeanName(beanInstance));
         final class NamedBean {
+            @SuppressWarnings("unused")
             public String getBeanName() {
                 return "b";
             }

Modified: incubator/cxf/trunk/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/pom.xml?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/distribution/pom.xml (original)
+++ incubator/cxf/trunk/distribution/pom.xml Fri Sep 29 11:28:43 2006
@@ -276,6 +276,45 @@
                     </archive>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>${antrun.version}</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>ant</groupId>
+                        <artifactId>ant-trax</artifactId>
+                        <version>1.6.5</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <id>process-sources-xsl</id>
+                        <phase>process-sources</phase>
+                        <configuration>
+                            <tasks>
+                                <xslt style="${basedir}/src/main/xsl/srcbuild_paths.xsl"
+                                      in="build.xml"
+                                      out="${basedir}/target/srcbuild_paths.xml">
+                                </xslt>
+                                <pathconvert property="cp" refid="maven.runtime.classpath"/>
+                                <condition property="output.cp" value="set CXF_CLASSPATH=${cp}">
+                                    <os family="windows"/>
+                                </condition>
+                                <condition property="output.ext" value=".bat">
+                                    <os family="windows"/>
+                                </condition>
+                                <property name="output.cp" value="export CXF_CLASSPATH=${cp}"/>
+                                <property name="output.ext" value=""/>
+                                <echo file="${basedir}/target/srcbuild_env${output.ext}"
message="${output.cp}"/>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Added: incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl?view=auto&rev=451379
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl (added)
+++ incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl Fri Sep 29 11:28:43 2006
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+    xmlns:xalan="http://xml.apache.org/xslt">
+
+    <xsl:output method="xml" indent="yes" xalan:indent-amount="4"/>
+    <xsl:strip-space elements="*"/>
+    
+
+    <!-- copy attributes from any node -->
+    <xsl:template match="@*" mode="attribute_copy">
+        <xsl:attribute name="{name(.)}">
+            <xsl:value-of select="."/>
+        </xsl:attribute>
+    </xsl:template>
+
+    <xsl:template match="path">
+        <project name="source-build-paths">
+            <property>
+                <xsl:attribute name="file">${user.home}/.m2/maven.properties</xsl:attribute>
+            </property>
+            <property name="maven.repo.local">
+                <xsl:attribute name="value">${user.home}/.m2/repository</xsl:attribute>
+            </property>
+            <path id="srcbuild.classpath.path">
+                <xsl:copy-of select="*"/>
+            </path>
+            <property name="srcbuild.classpath" refid="srcbuild.classpath.path"/>
+            <property name="activemq.home">
+                <xsl:attribute name="location">${basedir}/../../../../tools/activemq/3.2</xsl:attribute>
+            </property>
+            <property name="celtix.lib.dir">
+                <xsl:attribute name="location">${user.home}/.m2/repository</xsl:attribute>
+            </property>
+
+        </project>
+    </xsl:template>
+
+    <xsl:template match="echo">
+    </xsl:template>
+
+</xsl:stylesheet>

Propchange: incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/xsl/srcbuild_paths.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
Fri Sep 29 11:28:43 2006
@@ -30,8 +30,8 @@
 
 public class SoapBinding extends AbstractBasicInterceptorProvider implements Binding {
 
-    // default to support mtom, left to config to turn off this feature.
-    private boolean mtomEnabled = true;
+    // default to support mtom, left to config to turn on this feature.
+    private boolean mtomEnabled;
     
     private List<Interceptor> in;
     private List<Interceptor> out;

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
Fri Sep 29 11:28:43 2006
@@ -22,10 +22,19 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.xml.parsers.DocumentBuilder;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.message.AbstractWrappedMessage;
 import org.apache.cxf.message.Message;
 
 public class SoapMessage extends AbstractWrappedMessage {
+    private static final DocumentBuilder BUILDER = DOMUtils.createDocumentBuilder();
+
     
     private Map<Class<?>, Object> headers = new HashMap<Class<?>, Object>();

     
@@ -43,8 +52,21 @@
         this.version = v;
     }
 
+    public <T> boolean hasHeaders(Class<T> format) {
+        return headers.containsKey(format);
+    }
+    
     public <T> T getHeaders(Class<T> format) {
-        return format.cast(headers.get(format));
+        T t = format.cast(headers.get(format));
+        if (t == null && Element.class.equals(format)) {
+            Document doc = BUILDER.newDocument();
+            Element header = doc.createElementNS(version.getNamespace(),
+                                                 version.getHeader().getLocalPart());
+            header.setPrefix(version.getPrefix());
+            setHeaders(Element.class, header);
+            t = format.cast(header);
+        }
+        return t;
     }  
 
     public <T> void setHeaders(Class<T> format, T content) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -92,7 +92,11 @@
 
     private void buildMustUnderstandHeaders(Set<Element> mustUnderstandHeaders, SoapMessage
soapMessage,
                     Set<URI> serviceRoles) {
-        Element headers = (Element) soapMessage.getHeaders(Element.class);
+        
+        Element headers = null;
+        if (soapMessage.hasHeaders(Element.class)) {
+            headers = soapMessage.getHeaders(Element.class);
+        }
         List<Element> headerChilds = new ArrayList<Element>();
         if (headers != null) {
             for (int i = 0; i < headers.getChildNodes().getLength(); i++) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ReadHeadersInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.util.ResourceBundle;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -67,23 +68,24 @@
                 SoapVersion soapVersion = SoapVersionFactory.getInstance().getSoapVersion(ns);
                 message.setVersion(soapVersion);
                 
-                XMLStreamReader filteredReader = 
-                    new PartialXMLStreamReader(xmlReader, message.getVersion().getBody());
-                
-                Document doc = StaxUtils.read(filteredReader);
-                
-                Element envelop = (Element)doc.getChildNodes().item(0);
-                String header = soapVersion.getHeader().getLocalPart();
-                for (int i = 0; i < envelop.getChildNodes().getLength(); i++) {
-                    if (envelop.getChildNodes().item(i) instanceof Element) {
-                        Element element = (Element)envelop.getChildNodes().item(i);
-                        if (element.getLocalName().equals(header)) {
-                            message.setHeaders(Element.class, element);
-                            message.put(Element.class, element);
-                        }
+                QName qn = xmlReader.getName();
+                while (!qn.equals(message.getVersion().getBody())
+                    && !qn.equals(message.getVersion().getHeader())) {
+                    while (xmlReader.nextTag() != XMLStreamConstants.START_ELEMENT) {
+                        //nothing to do
                     }
+                    qn = xmlReader.getName();
                 }
+                if (qn.equals(message.getVersion().getHeader())) {
+                    XMLStreamReader filteredReader = 
+                        new PartialXMLStreamReader(xmlReader, message.getVersion().getBody());
                 
+                    Document doc = StaxUtils.read(filteredReader);
+
+                    Element element = (Element)doc.getChildNodes().item(0);
+                    message.setHeaders(Element.class, element);
+                    message.put(Element.class, element);                
+                }
                 // advance just past body.
                 xmlReader.next();
             }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -73,10 +73,13 @@
                                   soapVersion.getNamespace());
             xtw.writeNamespace(soapVersion.getPrefix(), soapVersion.getNamespace());
             
-            Element eleHeaders = message.getHeaders(Element.class);
-            boolean preexistingHeaders = eleHeaders != null && eleHeaders.hasChildNodes();
-            if (preexistingHeaders) {
-                StaxUtils.writeElement(eleHeaders, xtw, true, false);
+            boolean preexistingHeaders = false;
+            if (message.hasHeaders(Element.class)) {
+                Element eleHeaders = message.getHeaders(Element.class);
+                preexistingHeaders = eleHeaders != null && eleHeaders.hasChildNodes();
+                if (preexistingHeaders) {
+                    StaxUtils.writeElement(eleHeaders, xtw, true, false);
+                }
             }
             handleHeaderPart(preexistingHeaders, message);
        

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -21,21 +21,11 @@
 
 import java.util.HashMap;
 import java.util.List;
-import java.util.ResourceBundle;
 
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
 
 import org.apache.cxf.binding.soap.Soap11;
-import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
-import org.apache.cxf.common.i18n.BundleUtils;
-import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.phase.Phase;
 
@@ -49,9 +39,6 @@
  */
 public class SoapPreProtocolOutInterceptor extends AbstractSoapInterceptor {
 
-    private static final ResourceBundle BUNDLE =
-        BundleUtils.getBundle(SoapPreProtocolOutInterceptor.class);
-
     public SoapPreProtocolOutInterceptor() {
         super();
         setPhase(Phase.PRE_PROTOCOL);
@@ -65,7 +52,6 @@
      */
     public void handleMessage(SoapMessage message) throws Fault {
         ensureVersion(message);
-        ensureSoapHeader(message);
         ensureMimeHeaders(message);
     }
     
@@ -85,30 +71,6 @@
         if (soapVersion == null) {
             soapVersion = Soap11.getInstance();
             message.setVersion(soapVersion);
-        }
-    }
-
-    /**
-     * Ensure the SOAP header is set for this message.
-     * 
-     * @param message the current message
-     */
-    private void ensureSoapHeader(SoapMessage message) {
-        if (message.getHeaders(Element.class) == null) {
-            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-            DocumentBuilder builder;
-            try {
-                builder = builderFactory.newDocumentBuilder();
-            } catch (ParserConfigurationException e) {
-                Message msg = new Message("PARSER_EXC", BUNDLE);
-                throw new SoapFault(msg, e, SoapFault.SENDER);
-            }
-            Document doc = builder.newDocument();
-            SoapVersion v = message.getVersion();
-            Element header = doc.createElementNS(v.getNamespace(),
-                                                 v.getHeader().getLocalPart());
-            header.setPrefix(v.getPrefix());
-            message.setHeaders(Element.class, header);
         }
     }
     

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -45,11 +45,6 @@
 
     public void handleMessage(Message message) {
         InputStream is = message.getContent(InputStream.class);
-        
-
-        
-        
-
         assert is != null;
 
         // TODO: where does encoding constant go?
@@ -66,7 +61,7 @@
 
     protected XMLInputFactory getXMLInputFactory() {
         if (xif == null) {
-            return XMLInputFactory.newInstance();
+            xif = XMLInputFactory.newInstance();
         }
 
         return xif;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
Fri Sep 29 11:28:43 2006
@@ -65,7 +65,7 @@
 
     protected XMLOutputFactory getXMLOutputFactory() {
         if (xof == null) {
-            return XMLOutputFactory.newInstance();
+            xof = XMLOutputFactory.newInstance();
         }
 
         return xof;

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/AttachmentDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/AttachmentDeserializer.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/AttachmentDeserializer.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/attachment/AttachmentDeserializer.java
Fri Sep 29 11:28:43 2006
@@ -55,7 +55,7 @@
 
     private String contentType;
 
-    private List<CachedOutputStream> cache = new ArrayList<CachedOutputStream>();
+    private List<CachedOutputStream> cache;
 
     private Message message;
 
@@ -82,13 +82,17 @@
                         }
                     }
                 }
+                if (contentType == null) { 
+                    return false;
+                }
                 input = message.getContent(InputStream.class);
-                if (contentType == null || input == null) {
+                if (input == null) {
                     return false;
                 }
             }
             //printStream(input);
             if (contentType.toLowerCase().indexOf("multipart/related") != -1) {
+                cache = new ArrayList<CachedOutputStream>();
                 int i = contentType.indexOf("boundary=\"");
                 int end;
                 int len;
@@ -114,22 +118,22 @@
                 processSoapBody();
                 return true;
             }
-            return false;
         } catch (IOException ioe) {
             message.setContent(Exception.class, ioe);
-            return false;
         } catch (MessagingException me) {
             message.setContent(Exception.class, me);
-            return false;
         }
+        return false;
     }
 
     /**
      * release the resource
      */
     public void dispose() {
-        for (CachedOutputStream cos : cache) {
-            cos.dispose();
+        if (cache != null) {
+            for (CachedOutputStream cos : cache) {
+                cos.dispose();
+            }
         }
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
Fri Sep 29 11:28:43 2006
@@ -94,7 +94,6 @@
             Type[] para = method.getGenericParameterTypes();
             for (int i = 0; i < para.length; i++) {               
                 if (para[i] instanceof ParameterizedType) {
-                    Object param = null;
                     ParameterizedType paramType = (ParameterizedType) para[i];
                     if (((Class) paramType.getRawType()).getName().equals("javax.xml.ws.Holder"))
{
                         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
Fri Sep 29 11:28:43 2006
@@ -20,14 +20,16 @@
 package org.apache.cxf.jaxws.binding.soap;
 
 
+import java.util.Iterator;
 import java.util.Set;
 
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPFactory;
-import javax.xml.ws.WebServiceException;
 import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.cxf.binding.soap.SoapBinding;
+import org.apache.cxf.binding.soap.interceptor.AttachmentOutInterceptor;
+import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.jaxws.binding.BindingImpl;
 
 public class SOAPBindingImpl extends BindingImpl implements SOAPBinding {
@@ -52,7 +54,21 @@
     }
 
     public void setMTOMEnabled(boolean flag) {
-        throw new WebServiceException("MTOM is not supported");
+        if (flag != soapBinding.isMtomEnabled()) {
+            soapBinding.setMtomEnabled(flag);
+            if (flag) {
+                soapBinding.getOutInterceptors().add(new AttachmentOutInterceptor());
+            } else {
+                Iterator<Interceptor> it = soapBinding.getOutInterceptors().iterator();
+                while (it.hasNext()) {
+                    Interceptor intc = it.next();
+                    if (intc instanceof AttachmentOutInterceptor) {
+                        soapBinding.getOutInterceptors().remove(intc);
+                        return;
+                    }
+                }
+            }
+        }
     }
 
     public MessageFactory getMessageFactory() {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
Fri Sep 29 11:28:43 2006
@@ -309,11 +309,13 @@
         return null;
     }
     
+    
     private void printInterceptors(String type, List<Interceptor> interceptors) {
-        for (Interceptor i : interceptors) {
-            // System.out.println("    " + type + ": " + i.getClass().getName());
-        }
+        //for (Interceptor i : interceptors) {
+            //System.out.println("    " + type + ": " + i.getClass().getName());
+        //}
     }
+    
     
     @SuppressWarnings("unchecked")
     static final class TestInterceptor extends AbstractPhaseInterceptor {

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientServerMtomXopTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientServerMtomXopTest.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientServerMtomXopTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/mtom/ClientServerMtomXopTest.java
Fri Sep 29 11:28:43 2006
@@ -24,8 +24,11 @@
 import javax.activation.DataHandler;
 import javax.activation.DataSource;
 import javax.mail.util.ByteArrayDataSource;
+import javax.xml.ws.Binding;
+import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.Holder;
+import javax.xml.ws.soap.SOAPBinding;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -44,7 +47,10 @@
         protected void run() {
             Object implementor = new HelloImpl();
             String address = "http://localhost:9036/mime-test";
-            Endpoint.publish(address, implementor);
+            Endpoint ep = Endpoint.publish(address, implementor);
+            Binding binding = ep.getBinding();
+            assertTrue(binding instanceof SOAPBinding);
+            ((SOAPBinding)binding).setMTOMEnabled(true);
         }
 
         public static void main(String args[]) {
@@ -72,6 +78,9 @@
     public void testMtomSWA() throws Exception {
         HelloService hs = new HelloService();
         Hello hello = hs.getPort(Hello.class);
+        Binding binding = ((BindingProvider)hello).getBinding();
+        assertTrue(binding instanceof SOAPBinding);
+        ((SOAPBinding)binding).setMTOMEnabled(true);
         try {
             InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
             long fileSize = 0;
@@ -98,6 +107,9 @@
     public void testMtomXop() throws Exception {
         HelloService hs = new HelloService();
         Hello hello = hs.getPort(Hello.class);
+        Binding binding = ((BindingProvider)hello).getBinding();
+        assertTrue(binding instanceof SOAPBinding);
+        ((SOAPBinding)binding).setMTOMEnabled(true);
         try {
             InputStream pre = this.getClass().getResourceAsStream("/wsdl/mtom_xop.wsdl");
             long fileSize = 0;

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
Fri Sep 29 11:28:43 2006
@@ -268,7 +268,6 @@
             throw (Exception)ex.getCause();
         }
     }
-
     //--VerificationCache implementation
 
     public void put(String verification) {

Modified: incubator/cxf/trunk/test/performance/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/README.txt?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/README.txt (original)
+++ incubator/cxf/trunk/test/performance/README.txt Fri Sep 29 11:28:43 2006
@@ -3,7 +3,7 @@
 
 As described in the installation notes, extract the cxf
 binary distribution archive into an installation directory
-under the root drive.  This creates the sub-directory celtixfire,
+under the root drive.  This creates the sub-directory cxffire,
 which includes all of the product directories.
 
 1. setup the build Enviroment

Modified: incubator/cxf/trunk/test/performance/basic_type/bin/run_client
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/basic_type/bin/run_client?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/basic_type/bin/run_client (original)
+++ incubator/cxf/trunk/test/performance/basic_type/bin/run_client Fri Sep 29 11:28:43 2006
@@ -45,7 +45,7 @@
 
 done
 
-ant client -Dceltix.running.time=$AMOUNT -Dceltix.operation=$OPERARTION -Dceltix.basedon=$BASEDON
-Dceltix.packet.size=$PACKETSIZE -Dceltix.threads=$THREADS $PIPE
+ant client -Dcxf.running.time=$AMOUNT -Dcxf.operation=$OPERARTION -Dcxf.basedon=$BASEDON
-Dcxf.packet.size=$PACKETSIZE -Dcxf.threads=$THREADS $PIPE
 
 
                    

Modified: incubator/cxf/trunk/test/performance/basic_type/bin/run_client.bat
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/basic_type/bin/run_client.bat?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/basic_type/bin/run_client.bat (original)
+++ incubator/cxf/trunk/test/performance/basic_type/bin/run_client.bat Fri Sep 29 11:28:43
2006
@@ -21,6 +21,6 @@
 
 :Continue
 
-ant client -Dceltix.running.time=%AMOUNT% -Dceltix.operation=%OPERATION% -Dceltix.basedon=%BASEDON%
-Dceltix.packet.size=%PACKETSIZE% -Dceltix.threads=%THREADS%
+ant client -Dcxf.running.time=%AMOUNT% -Dcxf.operation=%OPERATION% -Dcxf.basedon=%BASEDON%
-Dcxf.packet.size=%PACKETSIZE% -Dcxf.threads=%THREADS%
 
 @endlocal

Modified: incubator/cxf/trunk/test/performance/basic_type/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/basic_type/build.xml?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/basic_type/build.xml (original)
+++ incubator/cxf/trunk/test/performance/basic_type/build.xml Fri Sep 29 11:28:43 2006
@@ -9,11 +9,11 @@
         <property name="pipe" value=""/>
         <cxf.client.run classname="org.apache.cxf.performance.basic_type.client.Client"
argline=
                 "-WSDL ${wsdl.dir}/${wsdl.file} 
-			 -Amount ${celtix.running.time} 
-			 -BasedOn ${celtix.basedon}
-			 -Operation ${celtix.operation}
-			 -PacketSize ${celtix.packet.size}
-			 -Threads ${celtix.threads} ${pipe}"/>
+			 -Amount ${cxf.running.time} 
+			 -BasedOn ${cxf.basedon}
+			 -Operation ${cxf.operation}
+			 -PacketSize ${cxf.packet.size}
+			 -Threads ${cxf.threads} ${pipe}"/>
     </target>
 
     <target name="server" description="run basic_type server">

Modified: incubator/cxf/trunk/test/performance/complex_type/bin/run_client
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/complex_type/bin/run_client?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/complex_type/bin/run_client (original)
+++ incubator/cxf/trunk/test/performance/complex_type/bin/run_client Fri Sep 29 11:28:43 2006
@@ -43,4 +43,4 @@
 done
 
 cd .. 
-ant client -Dceltix.running.time=$AMOUNT -Dceltix.operation=$OPERARTION -Dceltix.basedon=$BASEDON
-Dceltix.packet.size=$PACKETSIZE -Dceltix.threads=$THREADS $PIPE
+ant client -Dcxf.running.time=$AMOUNT -Dcxf.operation=$OPERARTION -Dcxf.basedon=$BASEDON
-Dcxf.packet.size=$PACKETSIZE -Dcxf.threads=$THREADS $PIPE

Modified: incubator/cxf/trunk/test/performance/complex_type/bin/run_client.bat
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/complex_type/bin/run_client.bat?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/complex_type/bin/run_client.bat (original)
+++ incubator/cxf/trunk/test/performance/complex_type/bin/run_client.bat Fri Sep 29 11:28:43
2006
@@ -21,6 +21,6 @@
 
 :Continue
 
-ant client -Dceltix.running.time=%AMOUNT% -Dceltix.operation=%OPERATION% -Dceltix.basedon=%BASEDON%
-Dceltix.packet.size=%PACKETSIZE% -Dceltix.threads=%THREADS%
+ant client -Dcxf.running.time=%AMOUNT% -Dcxf.operation=%OPERATION% -Dcxf.basedon=%BASEDON%
-Dcxf.packet.size=%PACKETSIZE% -Dcxf.threads=%THREADS%
 
 @endlocal

Modified: incubator/cxf/trunk/test/performance/complex_type/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/complex_type/build.xml?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/complex_type/build.xml (original)
+++ incubator/cxf/trunk/test/performance/complex_type/build.xml Fri Sep 29 11:28:43 2006
@@ -11,11 +11,11 @@
     <property name="pipe" value=""/>
 
     <cxf.client.run classname="org.apache.cxf.performance.complex_type.client.Client"
argline="-WSDL ${wsdl.dir}/${wsdl.file}
-													 -Amount ${celtix.running.time}
-													 -BasedOn ${celtix.basedon}
-													 -Operation ${celtix.operation}
-													 -PacketSize ${celtix.packet.size}
-													 -Threads ${celtix.threads} ${pipe}"/>
+													 -Amount ${cxf.running.time}
+													 -BasedOn ${cxf.basedon}
+													 -Operation ${cxf.operation}
+													 -PacketSize ${cxf.packet.size}
+													 -Threads ${cxf.threads} ${pipe}"/>
   </target> 
 
   <target name="server" description="run complex_type server">

Modified: incubator/cxf/trunk/test/performance/etc/common_build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/test/performance/etc/common_build.xml?view=diff&rev=451379&r1=451378&r2=451379
==============================================================================
--- incubator/cxf/trunk/test/performance/etc/common_build.xml (original)
+++ incubator/cxf/trunk/test/performance/etc/common_build.xml Fri Sep 29 11:28:43 2006
@@ -17,7 +17,7 @@
         <available file="../../lib/cxf.jar"/>
     </condition> 
     <!-- default setting --> 
-    <property name="srcbuild_paths.file" value="../../../celtixfire-distribution/target/srcbuild_paths.xml"/>

+    <property name="srcbuild_paths.file" value="../../../distribution/target/srcbuild_paths.xml"/>

 
     <import file="${srcbuild_paths.file}" optional="true"/>
     <property name="srcbuild.classpath" value=""/>    



Mime
View raw message