[cxf] branch 3.4.x-fixes updated: Provide some setters for the AsyncConduitFactory

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[cxf] branch 3.4.x-fixes updated: Provide some setters for the AsyncConduitFactory

Daniel  Kulp
Administrator
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
     new 995d299  Provide some setters for the AsyncConduitFactory
995d299 is described below

commit 995d2998be45e236eca781d9cc7bba9221da72a4
Author: Daniel Kulp <[hidden email]>
AuthorDate: Mon Nov 16 16:06:14 2020 -0500

    Provide some setters for the AsyncConduitFactory
   
    (cherry picked from commit 94bbe7392fe7d024455e43c90fb8a38e28530971)
---
 .../http/asyncclient/AsyncHttpTransportFactory.java       | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHttpTransportFactory.java b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHttpTransportFactory.java
index 8e15133..69b00b0 100644
--- a/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHttpTransportFactory.java
+++ b/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHttpTransportFactory.java
@@ -51,11 +51,16 @@ public class AsyncHttpTransportFactory extends AbstractTransportFactory implemen
         URI_PREFIXES.add("hc://");
     }
 
-    private final AsyncHTTPConduitFactory factory = new AsyncHTTPConduitFactory();
+    private AsyncHTTPConduitFactory factory = new AsyncHTTPConduitFactory();
 
     public AsyncHttpTransportFactory() {
         super(DEFAULT_NAMESPACES);
     }
+    
+    
+    public void setAsyncHTTPConduitFactory(AsyncHTTPConduitFactory f) {
+        factory = f;
+    }
 
     /**
      * This call is used by CXF ExtensionManager to inject the activationNamespaces
@@ -103,8 +108,12 @@ public class AsyncHttpTransportFactory extends AbstractTransportFactory implemen
         HTTPConduit conduit = null;
         // need to updated the endpointInfo
         endpointInfo.setAddress(getAddress(endpointInfo));
-
-        conduit = factory.createConduit(bus, endpointInfo, target);
+        
+        AsyncHTTPConduitFactory fact = bus.getExtension(AsyncHTTPConduitFactory.class);
+        if (fact == null) {
+            fact = factory;
+        }
+        conduit = fact.createConduit(bus, endpointInfo, target);
 
         // Spring configure the conduit.
         String address = conduit.getAddress();