cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] cxf git commit: Updating the way JAX-RS filter properties are passed around
Date Tue, 25 Nov 2014 21:12:49 GMT
Repository: cxf
Updated Branches:
  refs/heads/master df947cb1c -> 0aa08eec6


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

Branch: refs/heads/master
Commit: 81d40aa81c4a979f44a504348bfde9075a4622ee
Parents: 9f23528
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 17:33:38 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/81d40aa8/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/81d40aa8/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