You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2015/08/21 14:37:07 UTC
cxf git commit: Avoding a possible NPE in the async conduit factory
Repository: cxf
Updated Branches:
refs/heads/master 9f32e2bf5 -> c7a8af405
Avoding a possible NPE in the async conduit factory
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c7a8af40
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c7a8af40
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c7a8af40
Branch: refs/heads/master
Commit: c7a8af405f4766ada611a39e0675c39a6322e175
Parents: 9f32e2b
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Aug 21 13:36:52 2015 +0100
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Aug 21 13:36:52 2015 +0100
----------------------------------------------------------------------
.../asyncclient/AsyncHTTPConduitFactory.java | 22 ++++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/c7a8af40/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
index 089ed04..a5b94bf 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitFactory.java
@@ -282,15 +282,19 @@ public class AsyncHTTPConduitFactory implements HTTPConduitFactory {
private void addListener(Bus b) {
- b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(new BusLifeCycleListener() {
- public void initComplete() {
- }
- public void preShutdown() {
- shutdown();
- }
- public void postShutdown() {
- }
- });
+ BusLifeCycleManager manager = b.getExtension(BusLifeCycleManager.class);
+ if (manager != null) {
+
+ manager.registerLifeCycleListener(new BusLifeCycleListener() {
+ public void initComplete() {
+ }
+ public void preShutdown() {
+ shutdown();
+ }
+ public void postShutdown() {
+ }
+ });
+ }
}
public synchronized void setupNIOClient(HTTPClientPolicy clientPolicy) throws IOReactorException {