You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/06/26 18:10:00 UTC
[1/4] cxf git commit: setter for applicationExecutor This closes #284
Repository: cxf
Updated Branches:
refs/heads/3.1.x-fixes ec00a0800 -> ad3670fc3
setter for applicationExecutor This closes #284
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bdb04ca1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bdb04ca1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bdb04ca1
Branch: refs/heads/3.1.x-fixes
Commit: bdb04ca14e1a73b0f97369c2764033139c578b4e
Parents: ec00a08
Author: Maxim Samoylych <ms...@sberbank-tele.com>
Authored: Thu Jun 22 13:50:14 2017 +0200
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jun 26 13:18:43 2017 -0400
----------------------------------------------------------------------
.../netty/server/NettyHttpServerEngine.java | 83 ++++++++++++++++----
.../server/NettyHttpServletPipelineFactory.java | 19 ++++-
2 files changed, 81 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/bdb04ca1/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
index 8434060..820c0ac 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServerEngine.java
@@ -40,7 +40,8 @@ import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
-
+import io.netty.util.concurrent.DefaultEventExecutorGroup;
+import io.netty.util.concurrent.EventExecutorGroup;
public class NettyHttpServerEngine implements ServerEngine {
@@ -90,9 +91,10 @@ public class NettyHttpServerEngine implements ServerEngine {
private boolean sessionSupport;
// TODO need to setup configuration about them
- private EventLoopGroup bossGroup = new NioEventLoopGroup();
- private EventLoopGroup workerGroup = new NioEventLoopGroup();
-
+ private EventLoopGroup bossGroup;
+ private EventLoopGroup workerGroup;
+ private EventExecutorGroup applicationExecutor;
+
public NettyHttpServerEngine() {
}
@@ -104,14 +106,6 @@ public class NettyHttpServerEngine implements ServerEngine {
this.port = port;
}
- public String getProtocol() {
- return protocol;
- }
-
- public void setProtocol(String protocol) {
- this.protocol = protocol;
- }
-
@PostConstruct
public void finalizeConfig() {
// need to check if we need to any other thing other than Setting the TLSServerParameter
@@ -145,7 +139,16 @@ public class NettyHttpServerEngine implements ServerEngine {
}
protected Channel startServer() {
-
+ if (bossGroup == null) {
+ bossGroup = new NioEventLoopGroup();
+ }
+ if (workerGroup == null) {
+ workerGroup = new NioEventLoopGroup();
+ }
+ if (applicationExecutor == null) {
+ applicationExecutor = new DefaultEventExecutorGroup(threadingParameters.getThreadPoolSize());
+ }
+
final ServerBootstrap bootstrap = new ServerBootstrap();
bootstrap.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
@@ -154,10 +157,9 @@ public class NettyHttpServerEngine implements ServerEngine {
// Set up the event pipeline factory.
servletPipeline =
new NettyHttpServletPipelineFactory(
- tlsServerParameters, sessionSupport,
- threadingParameters.getThreadPoolSize(),
- maxChunkContentSize,
- handlerMap, this);
+ tlsServerParameters, sessionSupport,
+ maxChunkContentSize, handlerMap,
+ this, applicationExecutor);
// Start the servletPipeline's timer
servletPipeline.start();
bootstrap.childHandler(servletPipeline);
@@ -242,6 +244,9 @@ public class NettyHttpServerEngine implements ServerEngine {
// just unbind the channel
if (servletPipeline != null) {
servletPipeline.shutdown();
+ } else if (applicationExecutor != null) {
+ // shutdown executor if it set but not server started
+ applicationExecutor.shutdownGracefully();
}
if (serverChannel != null) {
@@ -300,4 +305,48 @@ public class NettyHttpServerEngine implements ServerEngine {
public String getHost() {
return host;
}
+
+ public String getProtocol() {
+ return protocol;
+ }
+
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ public void setBossGroup(EventLoopGroup bossGroup) {
+ if (this.bossGroup == null) {
+ this.bossGroup = bossGroup;
+ } else {
+ throw new IllegalStateException("bossGroup is already defined");
+ }
+ }
+
+ public EventLoopGroup getBossGroup() {
+ return bossGroup;
+ }
+
+ public void setWorkerGroup(EventLoopGroup workerGroup) {
+ if (this.workerGroup == null) {
+ this.workerGroup = workerGroup;
+ } else {
+ throw new IllegalStateException("workerGroup is already defined");
+ }
+ }
+
+ public EventLoopGroup getWorkerGroup() {
+ return workerGroup;
+ }
+
+ public EventExecutorGroup getApplicationExecutor() {
+ return applicationExecutor;
+ }
+
+ public void setApplicationExecutor(EventExecutorGroup applicationExecutor) {
+ if (this.applicationExecutor == null) {
+ this.applicationExecutor = applicationExecutor;
+ } else {
+ throw new IllegalStateException("applicationExecutor is already defined");
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/bdb04ca1/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
index 4357925..d7f158d 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
@@ -69,21 +69,32 @@ public class NettyHttpServletPipelineFactory extends ChannelInitializer<Channel>
private final NettyHttpServerEngine nettyHttpServerEngine;
- public NettyHttpServletPipelineFactory(TLSServerParameters tlsServerParameters,
+ /**
+ * @deprecated use {@link #NettyHttpServletPipelineFactory(TLSServerParameters, boolean, int, Map,
+ * NettyHttpServerEngine, EventExecutorGroup)}
+ */
+ @Deprecated
+ public NettyHttpServletPipelineFactory(TLSServerParameters tlsServerParameters,
boolean supportSession, int threadPoolSize, int maxChunkContentSize,
Map<String, NettyHttpContextHandler> handlerMap,
NettyHttpServerEngine engine) {
+ this(tlsServerParameters, supportSession, maxChunkContentSize, handlerMap, engine,
+ new DefaultEventExecutorGroup(threadPoolSize));
+ }
+
+ public NettyHttpServletPipelineFactory(TLSServerParameters tlsServerParameters,
+ boolean supportSession, int maxChunkContentSize,
+ Map<String, NettyHttpContextHandler> handlerMap,
+ NettyHttpServerEngine engine, EventExecutorGroup applicationExecutor) {
this.supportSession = supportSession;
this.watchdog = new HttpSessionWatchdog();
this.handlerMap = handlerMap;
this.tlsServerParameters = tlsServerParameters;
this.maxChunkContentSize = maxChunkContentSize;
this.nettyHttpServerEngine = engine;
- //TODO need to configure the thread size of EventExecutorGroup
- applicationExecutor = new DefaultEventExecutorGroup(threadPoolSize);
+ this.applicationExecutor = applicationExecutor;
}
-
public Map<String, NettyHttpContextHandler> getHttpContextHandlerMap() {
return handlerMap;
}
[2/4] cxf git commit: annotations should have Javadoc,
copied documentation from
https://cwiki.apache.org/confluence/display/CXF20DOC/JAXRSClientSpringBoot
Posted by dk...@apache.org.
annotations should have Javadoc, copied documentation from https://cwiki.apache.org/confluence/display/CXF20DOC/JAXRSClientSpringBoot
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6819cc59
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6819cc59
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6819cc59
Branch: refs/heads/3.1.x-fixes
Commit: 6819cc59fe842ce3cef4e148c0f6f94db6931c4a
Parents: bdb04ca
Author: Dennis Kieselhorst <de...@apache.org>
Authored: Sun Jun 25 15:00:22 2017 +0200
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jun 26 13:19:27 2017 -0400
----------------------------------------------------------------------
.../cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java | 9 +++++++++
.../cxf/jaxrs/client/spring/EnableJaxRsWebClient.java | 7 +++++++
2 files changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/6819cc59/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java
index ed8afee..b346e2f 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsProxyClient.java
@@ -25,6 +25,15 @@ import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
+/**
+ * Allows autowiring of proxy clients
+ *
+ * It creates a proxy from the auto-discovered service class interface.
+ * JAX-RS providers (annotated with @Provider) and marked as Spring Components are added to proxy clients.
+ * The providers which are not marked as Spring Components can also be optionally auto-discovered.
+ * Proxy can also be configured with optional headers such as Accept and Content-Type
+ * (if JAX-RS @Produces and/or @Consumes are missing or need to be overridden) and made thread-safe.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Import(JaxRsProxyClientConfiguration.class)
http://git-wip-us.apache.org/repos/asf/cxf/blob/6819cc59/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsWebClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsWebClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsWebClient.java
index be5a47f..cf1ad93 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsWebClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spring/EnableJaxRsWebClient.java
@@ -25,6 +25,13 @@ import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
+/**
+ * Allows autowiring of @{@link org.apache.cxf.jaxrs.client.WebClient}.
+ *
+ * JAX-RS providers (annotated with @Provider) and marked as Spring Components are added to WebClient.
+ * The providers which are not marked as Spring Components can also be optionally auto-discovered.
+ * WebClient can also be configured with optional headers such as Accept and Content-Type and made thread-safe.
+ */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Import(JaxRsWebClientConfiguration.class)
[4/4] cxf git commit: Recording .gitmergeinfo Changes
Posted by dk...@apache.org.
Recording .gitmergeinfo Changes
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ad3670fc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ad3670fc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ad3670fc
Branch: refs/heads/3.1.x-fixes
Commit: ad3670fc3f1f2ece2081b9e415358f60b6ff9af7
Parents: a7ab146
Author: Daniel Kulp <dk...@apache.org>
Authored: Mon Jun 26 13:20:41 2017 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jun 26 13:20:41 2017 -0400
----------------------------------------------------------------------
.gitmergeinfo | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/ad3670fc/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index e4a8b3a..c66b8f5 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -22,6 +22,7 @@ B 09893c1747d823b3456a28fc49468ed91e456f2d
B 09a3b58100c04cacf755509a0160ba01bbce769a
B 0a4d26766122177fe1a919ae1e00bb1d93712c6f
B 0af65a4ab3ef2c31b9e88d34ddfbb05c79f0f50c
+B 0b0ea50394d3fcd6401e51d81db5a90bd4bd5cff
B 0d4cd0bbcaa6a4f80552d6b38f2a5e721ab20de9
B 0d5577ab87f324205565c4534b59e69049505356
B 0dfaf8d72574511ad9027c663707f9e30b945fbc
@@ -33,6 +34,7 @@ B 1116dff4ec9f06e2e69b040f5aa03779c0424c23
B 111d52fd4b92d0222af9bf1c22156145ea01ed01
B 1224d5cc9f646aa3a4924ce9cb045366d2f4cdff
B 122d1f64f248294a4303632571ec363aea4c2179
+B 12577809de55186c2521c3519054383caace3794
B 1304bc2ffbe6b4c3bfdc4e4f47e5e224e52fd808
B 1329e2c2b2f83a7b6e80ad2f15a2602161343749
B 137485de37b3bf81e305e616a5af81741620f547
@@ -140,6 +142,7 @@ B 54e7c58d5449d5f91879674598fe1b1ee339a272
B 553329cd35e14013fbf727b392cf40374f399ba3
B 56dab42caaf27e3bedf08cbb419d3644aeccb7af
B 573405dd523139bb935339b89c28f849676da727
+B 57506614303663917781493546f37abc978ed663
B 57cb5447341949836b7d8cc8f00ca3ced68622f1
B 584df3ae111595da1b44ccd9db9567c2172bbb2e
B 58b379bdf8cce2434f6033e2d7adab944afff05b
@@ -157,6 +160,7 @@ B 604167d9f0cfc67e01219a19a95353176ce38f79
B 61a361610d57aaf18f2c574916621ac09af45151
B 61eadf5265cbcf47c8b2d5a6d6235eb2f621b456
B 62060f8bc1f4d85b77ff136cb0576049312b8541
+B 625f9fbde63a8a0052f9b3bc2a412033e367a139
B 629af817f4762a12623e76fb7f7baefe98482719
B 62fd990682c0c6ff915356fb9b5f0a32efc20424
B 63daada33c83c7900d5678ad495a0e764b3506de
@@ -189,10 +193,12 @@ B 741c9e349e7e48d3fe278ba8d8f17dd6bf4c4370
B 7463f091dcf08fb4bbfe58c261dda6bd1900460c
B 746cd3c0b850702e5b3601d18ce81652a1f3441f
B 762093f79fb799e3912ce572213f1a46eb02867c
+B 76877054e1a86220fe1a546acde9a12e7c63e10b
B 76d165c9f7d76de1e333eded6106fa0cc186131b
B 76edf9350e7640860b66196ad40396d54bbcb2b2
B 77c3f51dcb1f02c8799f4e09676c0697e76a0756
B 77e0ffed1a647a159d7b249071de87c049803885
+B 782cd824775c353c034d10821b271da2ecf50e13
B 79244372958dc1a9e382db4e1740e248bc8e2538
B 7a5e2690c36914ba481570c811f23d6e6b80bc07
B 7b7629682d15345518e66d46e575bf1ac334cf00
@@ -214,9 +220,11 @@ B 864dafbc5732fa51a79b45c0a3f3bf3dd378611b
B 885b65d32198083961e380c8c55c7d7a6d00ed33
B 89ae972bcc621be990531ce809ffa6f6e2c40ab8
B 8a4e85b24d6d5b438ceb28257c53773d46b5816d
+B 8b5cc1a7f7b1308932189546f458e8d1115dec43
B 8b86ab84acd8e5d11b9a2f3a960f1c40ba7d4bdb
B 8b92fe57dd9a661dab382da7d556b1972f513a93
B 8cea7c879658e83d7a4f54f6d4e8dfa0e449c67d
+B 8d7bd0e8c16154a184358b9c18e0f8c8e1ae7dbb
B 8e769d46b1a1bcc27da0740f23020a2776aff6e5
B 8e7d8e18e820dcaef748c2cab6091f884fe647a4
B 8ef43effed51b0339693a671f16c5d9a96e15bd7
@@ -274,6 +282,7 @@ B b667f5b29b97a96985bd3d2b9d63b2d3d2d7c27e
B b6a4763dc95c874004e600c78888796474f267b8
B b7cd2fb4b883cf9f6972d3593ecb0e1d31be7245
B b8132e5962e326355b699bca445afe9274d0f91d
+B b9191338ff4c00d36251adc352677212b0d6d7d0
B ba9fa0e7c7067b5e6536307c0cfdcf5154912647
B bacef091c2152d51ebdefbe20244e73d1c26b39d
B bbb04acb7c09d28ae8f662f1cbedd8c5f4d1bf1a
@@ -319,6 +328,7 @@ B cbf0fc5d1b2e80f92129078b0d1482f9e67fecb5
B ce274c7b4450279f2c0d4deae5bc5c3952af5c42
B ce6cdcff2bee46194baa3e3b63b93616fcaea9c8
B ced98c6e937bd93f92dac9043fa0406c696bfd84
+B cf11aa95ed031018b1b76512d0c6004bb3448058
B cf3f537d210c979dc3b3f49e08ebad5f0c02993c
B cf9ab27a843df4532d9bd78209aebcafee2ffffc
B d017d3cf4165e9d8fa849e29669cece562f55253
@@ -345,6 +355,7 @@ B de675431040a434c2bd1ef66667472fb4a49a9ab
B dfc84b0fac84e001069800b32f01529d50339cdb
B e14d803ff84be7c59dd7c2321f1090231967d45c
B e18b4fb7d5f4f585eea1a2637c5158cd6e0c61af
+B e1a5b307ca62fd05b23eb421b7a10c6d2b4b9a60
B e1c60863ac10b56d423613c7d3d2f45c7ce18e14
B e1d950605941ef77bd4a3e9e4ad47eb63ac8f221
B e262bd20dbc8e8567ffe0c8ed3d394191696e981
@@ -396,10 +407,12 @@ B f66dea949bdc3f136084115aca4e514bad426380
B f6ce97d4d38446c8336f6f713d0306d52edf6086
B f94e1dd9b2a8d27ec5a27bfb7c026e3ae2350e39
B f98785bd8490c4717353f1a9688cae3e7a823ec2
+B fada97326c967a947f1940237319902c1406eb78
B fb11380da6e5c157ffd311c2925eb533d134c8cb
B fb30f8bffc85fcc3208fcc0e1eda4b54a89b5d37
B fd77d3f3380f805db3547d37cbb2ff72bd033ad0
B fe3fd44a80d12efd7a4bc6f965451e63d63ee84c
+B feba8045486cd910b238065cbb3ee4a741198d76
M 00148006c5bc489794f2774134fcbebf1cd5f2f4
M 016140cc85a5c05ec762d4e4e092c259f76eb922
M 01933b8ae96dfef103d1bdc9fc922f644c581485
@@ -450,6 +463,7 @@ M 1e57d379863d01b9330fff797c14d81a56b0b0f2
M 1f9cbe3678c1984fd2fd57e26fdd5626841c32e9
M 20d0a2811c15cb65a402eb063e1359236d7014ea
M 21031e3ab2ae227540e2a078d0336d894361acba
+M 21618dad08506cc80edde02cf1661cecd06c49ab
M 2519863ca4d11ca1b6f3ac74361f3eaba3918690
M 2538ae42fb0c774023deed5264291b2fe6658cb8
M 26edcd457ea507075a4c82e2787f11f11a432876
@@ -458,6 +472,7 @@ M 2735d624afed00841621ce4fe0e9c864d76f5bcc
M 29af9d48cee34521fcc9bc27a79d15f5781916a9
M 2a76fe1ef1989fbfaf86d70984f049259715d3c4
M 2b1607831ccf97909122eae9247116d9a075c7cf
+M 2dc6d0569511332af00180390fd31b9c9b47f798
M 2e8219cf3d047abc3a7e2611bf284aadbc20b7d6
M 2ea81b5f7dd84d4d179a2d9ac77c5660a8aeb3c9
M 2f8a1f7645c30cb40d4f080ce4b4099964028751
@@ -517,6 +532,7 @@ M 5f6cb0745adc5d8cb6dd53a46751f56f42928d94
M 6070ddeef82e3b7366f1dc7d1252bc03af8766dd
M 6242c682dfce4a2ba4869978c28b14f1472484c1
M 62f994427bdd12863dc987e348eec1e24e6ce849
+M 62fdd5c09bfc4d436d77abcbe6dd50e99f1212a9
M 631ac6ba0765022a0f53500ac986b61cbabca60c
M 63a1088a9253da0452497440e900d35a5415c3c9
M 63e100e48f7c34ec167728497a3ef006a7a34024
@@ -525,6 +541,7 @@ M 6613e46662317ea151f72e26e5deb4f50148a148
M 66e97c77eaa43ab3a2cd95f0edc6a27e7445e8ce
M 6becb31c62ef0845a5078f4ec2124fe7bc264e58
M 6d7985f39b83d28b0ca3e485be8de8f986d6f6c1
+M 6fec911ee7848bd35c3ad5aaa5ff7607ba30e624
M 70a6f989e7062121a73ccdbc686dea4025d41f55
M 7228709bff3fe66626830b0018547d001588da00
M 726c0aa641e408a18fa5f4ff82df682d489874f4
@@ -553,6 +570,7 @@ M 8583a24ac541dc373503d7a6c59cd90890acdae3
M 85c390abd81c0a5590e83b2d5bd9c6cfc2f3bddc
M 86667619dc61c8a84672fc5a583b4517f48176c5
M 88d03f562405f0b1bbdb16b336810074b853db86
+M 88f8ce6eb41c557ece52b305959f6b2647bfb001
M 896f1abec915897967905762d6e850cfb6bac3bc
M 8aebfa30047f32e3a6b4feb7ffdd89208ec4f435
M 8b5ad0005d5e42bb51a90c6773aae12c5022f78b
@@ -593,6 +611,7 @@ M a304f27b8ad9da04dde3610932266c64baa3aa7e
M a42362e397b84d335015f7f9aa07b4f0bfb49260
M a61b4b82bea43ce695c4f51eb7cb3e9866dfae9d
M a644c5d06c0bae321e2c669efa0cecf3abdd944d
+M a6d18c83af6584cd9b5ec1215c9b3ef77906cd19
M a71508214a7682c6a569075b1395f387c31be63b
M a719adccae8500f2d7e7140a9f4cd26e20775818
M a7d5d525c05cf10a6ae12c25645c248d92dfac1c
@@ -672,6 +691,7 @@ M f133df0f691191fac9566726db06c9b4dc7b65a6
M f3304a89a7e93e9c466ee5dbd8d97ffe2d50f50f
M f40e11663072ee940dd412821c3ab98230445e5a
M f462c797eab75e9b6c6c352b4baeb84429866068
+M f5e8457e0fca31f8dc7af9b6368ba84331fcf742
M f7f017f2187d59369a7b94bb053f1e297972dce7
M f8439a92170c4cc6a13cf7b9a3c0eec994ebeec5
M f91541bed7e44624556b394cfba9b1a43c9bbdca
[3/4] cxf git commit: updated https sample to use latest httpclient
version
Posted by dk...@apache.org.
updated https sample to use latest httpclient version
# Conflicts:
# distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a7ab146e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a7ab146e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a7ab146e
Branch: refs/heads/3.1.x-fixes
Commit: a7ab146e9df58cff4d40de52c0ce9ba38b293290
Parents: 6819cc5
Author: Dennis Kieselhorst <de...@apache.org>
Authored: Sun Jun 25 15:15:12 2017 +0200
Committer: Daniel Kulp <dk...@apache.org>
Committed: Mon Jun 26 13:20:35 2017 -0400
----------------------------------------------------------------------
.../release/samples/jax_rs/basic_https/pom.xml | 2 +-
.../src/main/java/httpsdemo/client/Client.java | 30 ++++++++++++--------
2 files changed, 19 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/a7ab146e/distribution/src/main/release/samples/jax_rs/basic_https/pom.xml
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/basic_https/pom.xml b/distribution/src/main/release/samples/jax_rs/basic_https/pom.xml
index 756720a..723a6d8 100644
--- a/distribution/src/main/release/samples/jax_rs/basic_https/pom.xml
+++ b/distribution/src/main/release/samples/jax_rs/basic_https/pom.xml
@@ -29,7 +29,7 @@
<relativePath>../..</relativePath>
</parent>
<properties>
- <httpclient.version>4.2.1</httpclient.version>
+ <httpclient.version>4.5.3</httpclient.version>
</properties>
<profiles>
<profile>
http://git-wip-us.apache.org/repos/asf/cxf/blob/a7ab146e/distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java b/distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java
index 7147e2d..4f5751d 100644
--- a/distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java
+++ b/distribution/src/main/release/samples/jax_rs/basic_https/src/main/java/httpsdemo/client/Client.java
@@ -22,16 +22,19 @@ package httpsdemo.client;
import java.io.FileInputStream;
import java.security.KeyStore;
+import javax.net.ssl.SSLContext;
import javax.ws.rs.core.Response;
+
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
-import org.apache.http.conn.scheme.Scheme;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicHeader;
+import org.apache.http.ssl.SSLContexts;
import httpsdemo.common.Customer;
import httpsdemo.common.CustomerService;
@@ -50,24 +53,27 @@ public final class Client {
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(new FileInputStream(keyStoreLoc), "cspass".toCharArray());
- /*
+ SSLContext sslcontext = SSLContexts.custom()
+ .loadTrustMaterial(keyStore, null)
+ .loadKeyMaterial(keyStore, "ckpass".toCharArray()).build();
+
+ /*
* Send HTTP GET request to query customer info using portable HttpClient
* object from Apache HttpComponents
*/
- SSLSocketFactory sf = new SSLSocketFactory(keyStore, "ckpass", keyStore);
- Scheme httpsScheme = new Scheme("https", 9000, sf);
+ SSLConnectionSocketFactory sf = new SSLConnectionSocketFactory(sslcontext);
System.out.println("Sending HTTPS GET request to query customer info");
- DefaultHttpClient httpclient = new DefaultHttpClient();
- httpclient.getConnectionManager().getSchemeRegistry().register(httpsScheme);
+ CloseableHttpClient httpclient = HttpClients.custom().setSSLSocketFactory(sf).build();
HttpGet httpget = new HttpGet(BASE_SERVICE_URL + "/123");
BasicHeader bh = new BasicHeader("Accept", "text/xml");
httpget.addHeader(bh);
- HttpResponse response = httpclient.execute(httpget);
+ CloseableHttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
entity.writeTo(System.out);
- httpclient.getConnectionManager().shutdown();
-
+ response.close();
+ httpclient.close();
+
/*
* Send HTTP PUT request to update customer info, using CXF WebClient method
* Note: if need to use basic authentication, use the WebClient.create(baseAddress,