cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] git commit: [CXF-5837] Updating OutgoingChainInterceptor not to eneble the in caching if it is not needed
Date Fri, 04 Jul 2014 16:48:02 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 805f87717 -> 1fbf53076


[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/f3087f87
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f3087f87
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f3087f87

Branch: refs/heads/master
Commit: f3087f870b4a4001f2778be8e54090343e906935
Parents: 5a9bcf3
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:47:03 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/f3087f87/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
index 88f8b18..c1be1bd 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
+++ b/core/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/f3087f87/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 fcf95c5..7fd1f1b 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
@@ -75,6 +75,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