Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 41eaa4d97 -> fec88085f


Adding an http.maintain.session property to JAXRS 2.0 client


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

Branch: refs/heads/3.1.x-fixes
Commit: fec88085f5f97eb5b6b0bb3d5ceee7af1509876a
Parents: 41eaa4d
Author: Sergey Beryozkin <sberyoz...@gmail.com>
Authored: Fri Jan 13 17:06:25 2017 +0000
Committer: Sergey Beryozkin <sberyoz...@gmail.com>
Committed: Fri Jan 13 17:07:14 2017 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/fec88085/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
----------------------------------------------------------------------
diff --git 
a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java 
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
index d674b00..a976a7e 100644
--- 
a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
+++ 
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
@@ -46,6 +46,7 @@ import org.apache.cxf.jaxrs.client.ClientProviderFactory;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.cxf.jaxrs.model.FilterProviderInfo;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.transport.https.SSLUtils;
 
 public class ClientImpl implements Client {
@@ -54,6 +55,7 @@ public class ClientImpl implements Client {
     private static final String HTTP_PROXY_SERVER_PROP = 
"http.proxy.server.uri";
     private static final String HTTP_PROXY_SERVER_PORT_PROP = 
"http.proxy.server.port";
     private static final String HTTP_AUTOREDIRECT_PROP = "http.autoredirect";
+    private static final String HTTP_MAINTAIN_SESSION_PROP = 
"http.maintain.session";
     private static final String HTTP_RESPONSE_AUTOCLOSE_PROP = 
"http.response.stream.auto.close";
     private static final String THREAD_SAFE_CLIENT_PROP = "thread.safe.client";
     private static final String THREAD_SAFE_CLIENT_STATE_CLEANUP_PROP = 
"thread.safe.client.state.cleanup.period";
@@ -327,6 +329,10 @@ public class ClientImpl implements Client {
             if (autoRedirectValue != null) {
                 
clientCfg.getHttpConduit().getClient().setAutoRedirect(autoRedirectValue);
             }
+            Boolean mantainSessionValue = 
getBooleanValue(configProps.get(HTTP_MAINTAIN_SESSION_PROP));
+            if (mantainSessionValue != null) {
+                clientCfg.getRequestContext().put(Message.MAINTAIN_SESSION, 
mantainSessionValue);
+            }
         }
 
         private void initTargetClientIfNeeded(Map<String, Object> configProps) 
{

Reply via email to