cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5837] Updating OutgoingChainInterceptor not to eneble the in caching if it is not needed
Date Fri, 04 Jul 2014 16:53:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes a84a73b9b -> d41a1a123


[CXF-5837] Updating OutgoingChainInterceptor not to eneble the in caching if it is not needed


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d41a1a12
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d41a1a12
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d41a1a12

Branch: refs/heads/2.7.x-fixes
Commit: d41a1a123350c34521db9134615da20fe11cab5b
Parents: a84a73b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Jul 4 17:47:03 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Jul 4 17:53:30 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/interceptor/OutgoingChainInterceptor.java   | 6 ++++--
 .../main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d41a1a12/api/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java b/api/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
index 5bd5802..c7af0cc 100644
--- a/api/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
+++ b/api/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
@@ -47,7 +47,7 @@ import org.apache.cxf.transport.Conduit;
 
 public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message> {
     private static final Logger LOG = LogUtils.getL7dLogger(OutgoingChainInterceptor.class);
-    
+    private static final String CACHE_INPUT_PROPERTY = "cxf.io.cacheinput";
     private PhaseChainCache chainCache = new PhaseChainCache();
     
     public OutgoingChainInterceptor() {
@@ -60,7 +60,9 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
         //if we get this far, we're going to be outputting some valid content, but we COULD
         //also be "echoing" some of the content from the input.   Thus, we need to 
         //mark it as requiring the input to be cached.   
-        message.put("cxf.io.cacheinput", Boolean.TRUE);
+        if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) {
+            message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE);
+        }
         if (null != binding && null != binding.getOperationInfo() && binding.getOperationInfo().isOneWay())
{
             closeInput(message);
             return;

http://git-wip-us.apache.org/repos/asf/cxf/blob/d41a1a12/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
index 8ca60db..4cf056a 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/MessageContextImpl.java
@@ -76,6 +76,7 @@ public class MessageContextImpl implements MessageContext {
             try {
                 return createAttachments(key.toString());
             } catch (CacheSizeExceededException e) {
+                m.getExchange().put("cxf.io.cacheinput", null);
                 throw new WebApplicationException(413);
             }
         }


Mime
View raw message