[jbossws-commits] JBossWS SVN: r13495 - in stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf: interceptor and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Dec 15 00:24:26 EST 2010


Author: jim.ma
Date: 2010-12-15 00:24:25 -0500 (Wed, 15 Dec 2010)
New Revision: 13495

Added:
   stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableOneWayDecoupledFaultInterceptor.java
Modified:
   stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
Log:
[JBWS-3135]:Added the interceptor in BusHolder to enable one way decoupled FaultTo message

Modified: stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-12-15 05:16:23 UTC (rev 13494)
+++ stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java	2010-12-15 05:24:25 UTC (rev 13495)
@@ -38,6 +38,7 @@
 import org.jboss.wsf.spi.binding.BindingCustomization;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
+import org.jboss.wsf.stack.cxf.interceptor.EnableOneWayDecoupledFaultInterceptor;
 import org.jboss.wsf.stack.cxf.interceptor.EndpointAssociationInterceptor;
 
 /**
@@ -123,6 +124,7 @@
       //Install the EndpointAssociationInterceptor for linking every message exchange
       //with the proper spi Endpoint retrieved in CXFServletExt
       bus.getInInterceptors().add(new EndpointAssociationInterceptor());
+      bus.getInInterceptors().add(new EnableOneWayDecoupledFaultInterceptor());
    }
    
    protected static void setResourceResolver(Bus bus, ResourceResolver resourceResolver)

Added: stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableOneWayDecoupledFaultInterceptor.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableOneWayDecoupledFaultInterceptor.java	                        (rev 0)
+++ stack/cxf/branches/jbossws-cxf-3.4.1/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/EnableOneWayDecoupledFaultInterceptor.java	2010-12-15 05:24:25 UTC (rev 13495)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.interceptor;
+
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.ws.addressing.soap.MAPCodec;
+
+/**
+ * This intercetpor adds the context property decoupled_fault_support
+ * to enable decoupled faultTo. This is an optinal feature in cxf and we
+ * need this to be default to make it same behavior with native stack.
+ * @author <a href="mailto:ema at redhat.com>Jim Ma</a>
+ */
+public class EnableOneWayDecoupledFaultInterceptor extends AbstractPhaseInterceptor<Message>
+{
+
+   public EnableOneWayDecoupledFaultInterceptor()
+   {
+      super(Phase.PRE_PROTOCOL);
+      addBefore(MAPCodec.class.getName());
+   }
+
+   public void handleMessage(Message message)
+   {
+      message.put("org.apache.cxf.ws.addressing.oneway.decoupled_fault_support", true);
+   }
+
+   public void handleFault(Message message)
+   {
+      //complete
+   }
+
+}



More information about the jbossws-commits mailing list