You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/01/12 22:37:01 UTC
svn commit: r898528 - in /cxf/branches/2.2.x-fixes: ./
rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
systests/uncategorized/pom.xml
Author: dkulp
Date: Tue Jan 12 21:37:00 2010
New Revision: 898528
URL: http://svn.apache.org/viewvc?rev=898528&view=rev
Log:
Merged revisions 898526 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r898526 | dkulp | 2010-01-12 16:35:18 -0500 (Tue, 12 Jan 2010) | 1 line
[CXF-685] Add proper fault generation to RM Servant
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
cxf/branches/2.2.x-fixes/systests/uncategorized/pom.xml
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
svn:mergeinfo = /cxf/trunk:898526
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java?rev=898528&r1=898527&r2=898528&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java (original)
+++ cxf/branches/2.2.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/Servant.java Tue Jan 12 21:37:00 2010
@@ -27,7 +27,11 @@
import javax.xml.datatype.Duration;
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.Binding;
import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.jaxb.DatatypeFactory;
import org.apache.cxf.message.Exchange;
import org.apache.cxf.message.Message;
@@ -52,6 +56,25 @@
reliableEndpoint = rme;
}
+ private void throwSequenceFault(SequenceFault sf, Exchange exchange) {
+ Endpoint e = exchange.get(Endpoint.class);
+ Binding b = null;
+ if (null != e) {
+ b = e.getBinding();
+ }
+ Bus bus = exchange.get(Bus.class);
+ if (null != b && bus != null) {
+ RMManager m = bus.getExtension(RMManager.class);
+ LOG.fine("Manager: " + m);
+ BindingFaultFactory bff = m.getBindingFaultFactory(b);
+ Fault f = bff.createFault(sf);
+ LogUtils.log(LOG, Level.SEVERE, "SEQ_FAULT_MSG", bff.toString(f));
+ throw f;
+ }
+ throw new Fault(sf);
+ }
+
+
public Object invoke(Exchange exchange, Object o) {
LOG.fine("Invoking on RM Endpoint");
OperationInfo oi = exchange.get(OperationInfo.class);
@@ -60,16 +83,14 @@
return null;
}
- // TODO: throw Fault, see AbstractRMInterceptor
-
if (RMConstants.getCreateSequenceOperationName().equals(oi.getName())
|| RMConstants.getCreateSequenceOnewayOperationName().equals(oi.getName())) {
try {
return Collections.singletonList(createSequence(exchange.getInMessage()));
} catch (SequenceFault ex) {
- ex.printStackTrace();
+ throwSequenceFault(ex, exchange);
} catch (Exception ex) {
- ex.printStackTrace();
+ throw new Fault(ex);
}
} else if (RMConstants.getCreateSequenceResponseOnewayOperationName().equals(oi.getName())) {
CreateSequenceResponseType createResponse =
@@ -77,15 +98,15 @@
try {
createSequenceResponse(createResponse);
} catch (SequenceFault ex) {
- ex.printStackTrace();
+ throwSequenceFault(ex, exchange);
}
} else if (RMConstants.getTerminateSequenceOperationName().equals(oi.getName())) {
try {
terminateSequence(exchange.getInMessage());
} catch (SequenceFault ex) {
- ex.printStackTrace();
+ throwSequenceFault(ex, exchange);
} catch (RMException ex) {
- ex.printStackTrace();
+ throw new Fault(ex);
}
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/pom.xml?rev=898528&r1=898527&r2=898528&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/pom.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/pom.xml Tue Jan 12 21:37:00 2010
@@ -228,19 +228,9 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-ws-rm</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
<version>${project.version}</version>
</dependency>
- <!--dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-ws-security</artifactId>
- <version>${project.version}</version>
- </dependency-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>