You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by da...@apache.org on 2006/11/08 09:47:44 UTC
svn commit: r472424 - in /incubator/cxf/trunk:
api/src/main/java/org/apache/cxf/phase/
rt/bindings/http/src/main/resources/META-INF/cxf/
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/
rt/frontend/jaxws/src/main/java/org/apache/...
Author: dandiep
Date: Wed Nov 8 00:47:43 2006
New Revision: 472424
URL: http://svn.apache.org/viewvc?view=rev&rev=472424
Log:
Rethrow exceptions when in a subchain so we don't have to explicitly check for them. Also add spring http binding file.
Added:
incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml (with props)
Modified:
incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java?view=diff&rev=472424&r1=472423&r2=472424
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java Wed Nov 8 00:47:43 2006
@@ -149,8 +149,12 @@
if (!subChainState.empty() && subChainState.peek() == State.SUBCHAIN_COMPLETE) {
return true;
}
- } catch (Exception ex) {
+ } catch (RuntimeException ex) {
if (!faultOccured) {
+ if (subChainState.peek().equals(State.EXECUTING)) {
+ throw ex;
+ }
+
faultOccured = true;
if (LOG.isLoggable(Level.INFO)) {
LogUtils.log(LOG, Level.INFO, "Interceptor has thrown exception, unwinding now", ex);
Added: incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml?view=auto&rev=472424
==============================================================================
--- incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml (added)
+++ incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml Wed Nov 8 00:47:43 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean class="org.apache.cxf.binding.http.HttpBindingFactory" lazy-init="true">
+ <property name="bus" ref="cxf"/>
+ <property name="activationNamespaces">
+ <set>
+ <value>http://apache.org/cxf/binding/http</value>
+ </set>
+ </property>
+ </bean>
+</beans>
Propchange: incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/rt/bindings/http/src/main/resources/META-INF/cxf/cxf-extension-http-binding.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
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=472424&r1=472423&r2=472424
==============================================================================
--- 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 Wed Nov 8 00:47:43 2006
@@ -88,14 +88,8 @@
// Calling for Wrapped/RPC/Doc/ Interceptor for writing SOAP body
//message.getInterceptorChain().doIntercept(message);
- if (!message.getInterceptorChain().doInterceptInSubChain(message)
- && message.getContent(Exception.class) != null) {
- if (message.getContent(Exception.class) instanceof Fault) {
- throw (Fault)message.getContent(Exception.class);
- } else {
- throw new Fault(message.getContent(Exception.class));
- }
- }
+ message.getInterceptorChain().doInterceptInSubChain(message);
+
xtw.writeEndElement();
// Write Envelope end element
xtw.writeEndElement();
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?view=diff&rev=472424&r1=472423&r2=472424
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java Wed Nov 8 00:47:43 2006
@@ -46,7 +46,6 @@
import org.apache.cxf.binding.soap.interceptor.SoapInterceptor;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.helpers.XMLUtils;
-import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.interceptor.StaxOutInterceptor;
import org.apache.cxf.io.AbstractCachedOutputStream;
import org.apache.cxf.jaxws.handler.AbstractProtocolHandlerInterceptor;
@@ -92,14 +91,7 @@
CachedStream cs = new CachedStream();
message.setContent(OutputStream.class, cs);
- if (message.getInterceptorChain().doInterceptInSubChain(message)
- && message.getContent(Exception.class) != null) {
- if (message.getContent(Exception.class) instanceof Fault) {
- throw (Fault)message.getContent(Exception.class);
- } else {
- throw new Fault(message.getContent(Exception.class));
- }
- }
+ message.getInterceptorChain().doInterceptInSubChain(message);
super.handleMessage(message);