hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsedd...@apache.org
Subject svn commit: r1762930 - /httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java
Date Fri, 30 Sep 2016 16:07:23 GMT
Author: jsedding
Date: Fri Sep 30 16:07:23 2016
New Revision: 1762930

URL: http://svn.apache.org/viewvc?rev=1762930&view=rev
Log:
HTTPCLIENT-1773: [OSGi] HttpProxyConfigurationActivator does not unregister HttpClientBuilderFactory

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java?rev=1762930&r1=1762929&r2=1762930&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient-osgi/src/main/java/org/apache/http/osgi/impl/HttpProxyConfigurationActivator.java
Fri Sep 30 16:07:23 2016
@@ -66,6 +66,8 @@ public final class HttpProxyConfiguratio
 
     private ServiceRegistration clientFactory;
 
+    private ServiceRegistration cachingClientFactory;
+
     private BundleContext context;
 
     private final Map<String, ServiceRegistration> registeredConfigurations = new LinkedHashMap<String,
ServiceRegistration>();
@@ -103,7 +105,7 @@ public final class HttpProxyConfiguratio
         props.put(Constants.SERVICE_PID, CACHEABLE_BUILDER_FACTORY_SERVICE_PID);
         props.put(Constants.SERVICE_VENDOR, context.getBundle().getHeaders().get(Constants.BUNDLE_VENDOR));
         props.put(Constants.SERVICE_DESCRIPTION, CACHEABLE_BUILDER_FACTORY_SERVICE_NAME);
-        clientFactory = context.registerService(CachingHttpClientBuilderFactory.class.getName(),
+        cachingClientFactory = context.registerService(CachingHttpClientBuilderFactory.class.getName(),
                 new OSGiCachingClientBuilderFactory(context, registeredConfigurations, trackedHttpClients),
                 props);
     }
@@ -127,6 +129,10 @@ public final class HttpProxyConfiguratio
             clientFactory.unregister();
         }
 
+        if (cachingClientFactory != null) {
+            cachingClientFactory.unregister();
+        }
+
         // ensure all http clients - generated with the - are terminated
         for (final CloseableHttpClient client : trackedHttpClients) {
             if (null != client) {



Mime
View raw message