cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1086115 - in /cxf/trunk/rt/transports: http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/ http/src/main/java/org/apache/cxf/transport/http/ jms/src/main/java/org/apache/cxf/transport/jms/continuations/
Date Mon, 28 Mar 2011 04:11:40 GMT
Author: ningjiang
Date: Mon Mar 28 04:11:39 2011
New Revision: 1086115

URL: http://svn.apache.org/viewvc?rev=1086115&view=rev
Log:
CXF-3427 JMSContinuation should be thread safe

Modified:
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Servlet3ContinuationProvider.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java?rev=1086115&r1=1086114&r2=1086115&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationWrapper.java
Mon Mar 28 04:11:39 2011
@@ -30,13 +30,13 @@ import org.eclipse.jetty.server.AsyncCon
 import org.eclipse.jetty.server.Request;
 
 public class JettyContinuationWrapper implements Continuation, ContinuationListener {
-    boolean isNew;
-    boolean isResumed;
-    boolean isPending;
-    Object obj;
+    volatile boolean isNew;
+    volatile boolean isResumed;
+    volatile boolean isPending;
+    volatile Object obj;
     
     private Message message;
-    private AsyncContext context;
+    private final AsyncContext context;
     private final Request req;
     
     public JettyContinuationWrapper(HttpServletRequest request, 

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Servlet3ContinuationProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Servlet3ContinuationProvider.java?rev=1086115&r1=1086114&r2=1086115&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Servlet3ContinuationProvider.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Servlet3ContinuationProvider.java
Mon Mar 28 04:11:39 2011
@@ -61,11 +61,11 @@ public class Servlet3ContinuationProvide
     }
     
     public class Servlet3Continuation implements Continuation, AsyncListener {
-        AsyncContext context;
-        boolean isNew;
-        boolean isResumed;
-        boolean isPending;
-        Object obj;
+        final AsyncContext context;
+        volatile boolean isNew;
+        volatile boolean isResumed;
+        volatile boolean isPending;
+        volatile Object obj;
         
         public Servlet3Continuation() {
             // It looks current Servlet3 implementation request doesn't pass the isAsyncStart


Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=1086115&r1=1086114&r2=1086115&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Mon Mar 28 04:11:39 2011
@@ -41,11 +41,11 @@ public class JMSContinuation implements 
     private AbstractMessageListenerContainer jmsListener;
     private JMSConfiguration jmsConfig;
     
-    private Object userObject;
+    private volatile Object userObject;
     
-    private boolean isNew = true;
-    private boolean isPending;
-    private boolean isResumed;
+    private volatile boolean isNew = true;
+    private volatile boolean isPending;
+    private volatile boolean isResumed;
     private Timer timer;
     
     public JMSContinuation(Bus b, Message m, MessageObserver observer,
@@ -93,7 +93,7 @@ public class JMSContinuation implements 
         doResume();
     }
     
-    protected void doResume() {
+    protected synchronized void doResume() {
         updateContinuations(true);
         BusFactory.setThreadDefaultBus(bus);
         try {



Mime
View raw message