You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/07 12:17:02 UTC

camel git commit: The HttpMessage should override newInstance when using a specialzed Message class.

Repository: camel
Updated Branches:
  refs/heads/master d72b9af01 -> b494104ad


The HttpMessage should override newInstance when using a specialzed Message class.


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

Branch: refs/heads/master
Commit: b494104ad8db3938d5bc0f1408faae56b96f641d
Parents: d72b9af
Author: Claus Ibsen <da...@apache.org>
Authored: Thu Apr 7 12:16:53 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Thu Apr 7 12:16:53 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/http/common/HttpMessage.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b494104a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpMessage.java
----------------------------------------------------------------------
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpMessage.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpMessage.java
index a56f886..7dd296d 100644
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpMessage.java
+++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpMessage.java
@@ -52,6 +52,12 @@ public class HttpMessage extends DefaultMessage {
         getEndpoint().getHttpBinding().readRequest(request, this);
     }
 
+    private HttpMessage(HttpServletRequest request, HttpServletResponse response, Exchange exchange) {
+        this.request = request;
+        this.response = response;
+        setExchange(getExchange());
+    }
+
     public HttpServletRequest getRequest() {
         return request;
     }
@@ -68,7 +74,12 @@ public class HttpMessage extends DefaultMessage {
             throw new RuntimeCamelException(e);
         }
     }
-    
+
+    @Override
+    public HttpMessage newInstance() {
+        return new HttpMessage(request, response, getExchange());
+    }
+
     private HttpCommonEndpoint getEndpoint() {
         return (HttpCommonEndpoint) getExchange().getFromEndpoint();
     }