Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 14404 invoked from network); 18 Jun 2010 16:34:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jun 2010 16:34:11 -0000 Received: (qmail 87773 invoked by uid 500); 18 Jun 2010 16:34:11 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 87715 invoked by uid 500); 18 Jun 2010 16:34:11 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 87707 invoked by uid 99); 18 Jun 2010 16:34:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 16:34:11 +0000 X-ASF-Spam-Status: No, hits=-1390.1 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2010 16:34:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5C2CA2388993; Fri, 18 Jun 2010 16:33:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r956042 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/phase/ rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/ rt/core/src/main/java/org/apache/cxf/interceptor/ Date: Fri, 18 Jun 2010 16:33:24 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100618163324.5C2CA2388993@eris.apache.org> Author: dkulp Date: Fri Jun 18 16:33:23 2010 New Revision: 956042 URL: http://svn.apache.org/viewvc?rev=956042&view=rev Log: Merged revisions 956035 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r956035 | dkulp | 2010-06-18 12:14:21 -0400 (Fri, 18 Jun 2010) | 2 lines [CXF-2856] Make sure the connection isn't opened twice for the HTTP binding stuff ........ Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DatabindingOutSetupInterceptor.java cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DocumentWriterInterceptor.java cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java Propchange: cxf/branches/2.2.x-fixes/ ('svn:mergeinfo' removed) Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?rev=956042&r1=956041&r2=956042&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original) +++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Fri Jun 18 16:33:23 2010 @@ -31,6 +31,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.apache.cxf.common.logging.LogUtils; +import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.continuations.SuspendedInvocationException; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; @@ -613,7 +614,11 @@ public class PhaseInterceptorChain imple } else { chain.append(", "); } - chain.append(i.interceptor.getClass().getSimpleName()); + String nm = i.interceptor.getClass().getSimpleName(); + if (StringUtils.isEmpty(nm)) { + nm = i.interceptor.getId(); + } + chain.append(nm); i = i.next; } chain.append("]\n"); Modified: cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DatabindingOutSetupInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DatabindingOutSetupInterceptor.java?rev=956042&r1=956041&r2=956042&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DatabindingOutSetupInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DatabindingOutSetupInterceptor.java Fri Jun 18 16:33:23 2010 @@ -33,6 +33,7 @@ import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.helpers.MapNamespaceContext; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.InterceptorChain; +import org.apache.cxf.interceptor.MessageSenderInterceptor; import org.apache.cxf.interceptor.StaxOutInterceptor; import org.apache.cxf.interceptor.WrappedOutInterceptor; import org.apache.cxf.message.Message; @@ -65,7 +66,6 @@ public class DatabindingOutSetupIntercep nsMap.addNamespace(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD); writer.setNamespaceContext(nsMap); } catch (XMLStreamException e) { - e.printStackTrace(); // ignore } message.setContent(XMLStreamWriter.class, writer); @@ -74,10 +74,9 @@ public class DatabindingOutSetupIntercep wrappedOut.addAfter(getId()); chain.add(wrappedOut); - XMLMessageOutInterceptor xmlOut = new XMLMessageOutInterceptor(Phase.PRE_LOGICAL); + final XMLMessageOutInterceptor xmlOut = new XMLMessageOutInterceptor(Phase.PRE_LOGICAL); xmlOut.addAfter(wrappedOut.getId()); chain.add(xmlOut); - Endpoint ep = message.getExchange().get(Endpoint.class); URIMapper mapper = (URIMapper) ep.getService().get(URIMapper.class.getName()); @@ -88,9 +87,18 @@ public class DatabindingOutSetupIntercep boolean putOrPost = verb.equals(HttpConstants.POST) || verb.equals(HttpConstants.PUT); if (putOrPost) { - chain.doIntercept(message); chain.add(new URIParameterOutInterceptor()); chain.add(new DocumentWriterInterceptor()); + chain.add(new AbstractPhaseInterceptor("remove-writer", + Phase.PREPARE_SEND) { + { + addAfter(xmlOut.getId()); + addBefore(MessageSenderInterceptor.class.getName()); + } + public void handleMessage(Message message) throws Fault { + message.removeContent(XMLStreamWriter.class); + } + }); chain.add(STAX_OUT); } else { chain.add(new URIParameterOutInterceptor()); Modified: cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DocumentWriterInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DocumentWriterInterceptor.java?rev=956042&r1=956041&r2=956042&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DocumentWriterInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/bindings/http/src/main/java/org/apache/cxf/binding/http/interceptor/DocumentWriterInterceptor.java Fri Jun 18 16:33:23 2010 @@ -22,6 +22,7 @@ import javax.xml.stream.XMLStreamExcepti import javax.xml.stream.XMLStreamWriter; import org.w3c.dom.Document; +import org.w3c.dom.Node; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Message; @@ -36,7 +37,8 @@ public class DocumentWriterInterceptor e } public void handleMessage(Message message) throws Fault { - Document doc = message.getContent(Document.class); + Node n = message.getContent(Node.class); + Document doc = (Document)n; XMLStreamWriter writer = message.getContent(XMLStreamWriter.class); try { Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?rev=956042&r1=956041&r2=956042&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java (original) +++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java Fri Jun 18 16:33:23 2010 @@ -38,13 +38,14 @@ import org.apache.cxf.staxutils.StaxUtil public class WrappedOutInterceptor extends AbstractOutDatabindingInterceptor { private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WrappedOutInterceptor.class); - private WrappedOutEndingInterceptor ending = new WrappedOutEndingInterceptor(); + private final WrappedOutEndingInterceptor ending; public WrappedOutInterceptor() { this(Phase.MARSHAL); } public WrappedOutInterceptor(String phase) { super(phase); + ending = new WrappedOutEndingInterceptor(phase + "-ending"); addBefore(BareOutInterceptor.class.getName()); } @@ -90,8 +91,8 @@ public class WrappedOutInterceptor exten } public class WrappedOutEndingInterceptor extends AbstractOutDatabindingInterceptor { - public WrappedOutEndingInterceptor() { - super(Phase.MARSHAL_ENDING); + public WrappedOutEndingInterceptor(String phase) { + super(phase); } public void handleMessage(Message message) throws Fault {