cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r781586 - in /cxf/branches/2.1.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Date Wed, 03 Jun 2009 21:29:52 GMT
Author: dkulp
Date: Wed Jun  3 21:29:51 2009
New Revision: 781586

URL: http://svn.apache.org/viewvc?rev=781586&view=rev
Log:
Merged revisions 781497 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r781497 | dkulp | 2009-06-03 14:00:44 -0400 (Wed, 03 Jun 2009) | 2 lines
  
  Allow the JMS transport to allow one-way operations to proceed on the
  original thread so transactions will work.
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
    cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jun  3 21:29:51 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java?rev=781586&r1=781585&r2=781586&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
Wed Jun  3 21:29:51 2009
@@ -37,6 +37,9 @@
  * 
  */
 public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message> {
+    public static final String USE_ORIGINAL_THREAD 
+        = OneWayProcessorInterceptor.class.getName() + ".USE_ORIGINAL_THREAD"; 
+    
     public OneWayProcessorInterceptor() {
         super(Phase.PRE_LOGICAL);
     }
@@ -67,14 +70,21 @@
                 //IGNORE
             }
             
-            
-            chain.pause();
-            message.getExchange().get(Bus.class).getExtension(WorkQueueManager.class)
-                .getAutomaticWorkQueue().execute(new Runnable() {
-                    public void run() {
-                        chain.resume();
-                    }
-                });
+            Object o = message.getContextualProperty(USE_ORIGINAL_THREAD);
+            if (o == null) {
+                o = Boolean.FALSE;
+            } else if (o instanceof String) {
+                o = Boolean.valueOf((String)o);
+            }
+            if (Boolean.FALSE.equals(o)) {
+                chain.pause();
+                message.getExchange().get(Bus.class).getExtension(WorkQueueManager.class)
+                    .getAutomaticWorkQueue().execute(new Runnable() {
+                        public void run() {
+                            chain.resume();
+                        }
+                    });
+            }
         }
     }
     

Modified: cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=781586&r1=781585&r2=781586&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Wed Jun  3 21:29:51 2009
@@ -48,6 +48,7 @@
 import org.apache.cxf.continuations.ContinuationProvider;
 import org.apache.cxf.continuations.SuspendedInvocationException;
 import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.OneWayProcessorInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
@@ -82,6 +83,7 @@
         super(b, getTargetReference(info, b), info);
         this.bus = b;
         this.jmsConfig = jmsConfig;
+        info.setProperty(OneWayProcessorInterceptor.USE_ORIGINAL_THREAD, Boolean.TRUE);
     }
 
     /**



Mime
View raw message