cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Updating the way JAX-RS filter properties are passed around
Date Tue, 25 Nov 2014 21:17:27 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 390a40b29 -> 9e0f958d8


Updating the way JAX-RS filter properties are passed around


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

Branch: refs/heads/3.0.x-fixes
Commit: 9e0f958d80f26523ce0e875662ae3fab8d528c3f
Parents: 390a40b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Nov 25 17:33:38 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Nov 25 21:16:09 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java    | 4 ++--
 .../cxf/jaxrs/client/spec/ClientRequestContextImpl.java     | 9 ++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9e0f958d/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java
index dc35dc4..215adb8 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/PropertyHolderFactory.java
@@ -49,7 +49,7 @@ public final class PropertyHolderFactory {
         
         public MessagePropertyHolder(Message m) {
             this.m = m;
-            this.props = CastUtils.cast((Map<?, ?>)m.get(PROPERTY_KEY));
+            this.props = CastUtils.cast((Map<?, ?>)m.getExchange().get(PROPERTY_KEY));
         }
         public Object getProperty(String name) {
             return props == null ? null : props.get(name);
@@ -65,7 +65,7 @@ public final class PropertyHolderFactory {
         public void setProperty(String name, Object value) {
             if (props == null) {
                 props = new HashMap<String, Object>();
-                m.put(PROPERTY_KEY, props);
+                m.getExchange().put(PROPERTY_KEY, props);
             }    
             if (value == null) {
                 removeProperty(name);

http://git-wip-us.apache.org/repos/asf/cxf/blob/9e0f958d/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
index 3f76cea..9ee363c 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
@@ -148,7 +148,14 @@ public class ClientRequestContextImpl extends AbstractRequestContextImpl
     @Override
     public URI getUri() {
         String requestURI = (String)m.get(Message.REQUEST_URI);
-        return requestURI  == null ? null : URI.create(requestURI);
+        if (requestURI  == null) {
+            return null;
+        }
+        if (requestURI.startsWith("/")) {
+            String endpointAddress = (String)m.get(Message.ENDPOINT_ADDRESS);
+            requestURI = requestURI.length() == 1 ? endpointAddress : endpointAddress + requestURI;
    
+        }
+        return URI.create(requestURI);
     }
 
     @Override


Mime
View raw message