cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1457863 - in /cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client: WebClient.java spec/ClientRequestContextImpl.java
Date Mon, 18 Mar 2013 16:59:20 GMT
Author: sergeyb
Date: Mon Mar 18 16:59:19 2013
New Revision: 1457863

URL: http://svn.apache.org/r1457863
Log:
Minor update to JAX-RS ClientRequestContextImpl

Modified:
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
    cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=1457863&r1=1457862&r2=1457863&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Mon Mar
18 16:59:19 2013
@@ -1102,12 +1102,17 @@ public class WebClient extends AbstractC
                 requestClass = (Class<?>)requestContext.get(REQUEST_CLASS);
                 requestType = (Type)requestContext.get(REQUEST_TYPE);
             }
+            Annotation[] anns = new Annotation[]{};
+            Annotation[] customAnns = (Annotation[])outMessage.get(Annotation.class.getName());
+            if (customAnns != null) {
+                anns = customAnns;
+            }
             boolean isAssignable = requestClass != null && requestClass.isAssignableFrom(body.getClass());
             try {
                 writeBody(body, outMessage, 
                           requestClass == null || !isAssignable ? body.getClass() : requestClass,
                           requestType == null || !isAssignable ? body.getClass() : requestType,

-                          new Annotation[]{}, os);
+                          anns, os);
             } catch (Exception ex) {
                 throw new Fault(ex);
             }

Modified: cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java?rev=1457863&r1=1457862&r2=1457863&view=diff
==============================================================================
--- cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
(original)
+++ cxf/trunk/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
Mon Mar 18 16:59:19 2013
@@ -69,8 +69,8 @@ public class ClientRequestContextImpl ex
 
     @Override
     public Annotation[] getEntityAnnotations() {
-        // TODO Auto-generated method stub
-        return null;
+        Annotation[] anns = (Annotation[])m.get(Annotation.class.getName());
+        return anns == null ? new Annotation[] {} : anns;
     }
 
     @Override
@@ -103,6 +103,9 @@ public class ClientRequestContextImpl ex
             headers.putSingle(HttpHeaders.CONTENT_TYPE, mt);
             m.put(Message.CONTENT_TYPE, mt.toString());
         }
+        if (anns != null) {
+            m.put(Annotation.class.getName(), anns);
+        }
         doSetEntity(entity);
     }
     



Mime
View raw message