Author: ffang
Date: Wed Jul 15 05:55:18 2009
New Revision: 794143
URL: http://svn.apache.org/viewvc?rev=794143&view=rev
Log:
[SMXCOMP-589]cxf bc provider shouldn't try to set fault message back to InOnly
MessageExchange
Added:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL:
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=794143&r1=794142&r2=794143&view=diff
==============================================================================
---
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Wed Jul 15 05:55:18 2009
@@ -28,6 +28,7 @@
import javax.jbi.management.DeploymentException;
import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOnly;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;
import javax.jbi.messaging.NormalizedMessage;
@@ -228,7 +229,9 @@
is.close();
os.close();
} catch (Exception e) {
- faultProcess(exchange, message, e);
+ if (!(exchange instanceof InOnly)) {
+ faultProcess(exchange, message, e);
+ }
}
if (boi.getOperationInfo().isOneWay()) {
exchange.setStatus(ExchangeStatus.DONE);
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
URL:
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java?rev=794143&r1=794142&r2=794143&view=diff
==============================================================================
---
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
(original)
+++
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/CxfBcProviderTest.java
Wed Jul 15 05:55:18 2009
@@ -164,6 +164,7 @@
//test concurrency
concurrency();
// Shutdown CXF Service/Endpoint so that next test doesn't fail.
+ Thread.sleep(5000); //sleep so we get chance to see the behavior of
oneway exception
factory.getBus().shutdown(true);
}
Added:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
URL:
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java?rev=794143&view=auto
==============================================================================
---
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
(added)
+++
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/java/org/apache/servicemix/cxfbc/interceptors/ThrowExceptionForOneWay.java
Wed Jul 15 05:55:18 2009
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.servicemix.cxfbc.interceptors;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class ThrowExceptionForOneWay extends AbstractPhaseInterceptor<Message>
{
+
+ public ThrowExceptionForOneWay() {
+ super(Phase.PREPARE_SEND);
+ }
+
+
+ public void handleMessage(Message message) throws Fault {
+ if (message.getExchange().isOneWay()) {
+ throw new RuntimeException("intend for test oneway with
Exception");
+ }
+
+ }
+
+}
Modified:
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
URL:
http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml?rev=794143&r1=794142&r2=794143&view=diff
==============================================================================
---
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
(original)
+++
servicemix/smx3/branches/servicemix-3.2/deployables/bindingcomponents/servicemix-cxf-bc/src/test/resources/org/apache/servicemix/cxfbc/provider.xml
Wed Jul 15 05:55:18 2009
@@ -62,6 +62,7 @@
</cxfbc:inInterceptors>
<cxfbc:outInterceptors>
<bean
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ <bean
class="org.apache.servicemix.cxfbc.interceptors.ThrowExceptionForOneWay"/>
</cxfbc:outInterceptors>
<cxfbc:inFaultInterceptors>
<bean
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>