Author: gnodet
Date: Wed May 2 06:10:55 2007
New Revision: 534447
URL: http://svn.apache.org/viewvc?view=rev&rev=534447
Log:
SM-928: ProviderProcessor leaks memory for https endpoints
Modified:
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
Modified:
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
URL:
http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java?view=diff&rev=534447&r1=534446&r2=534447
==============================================================================
---
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
(original)
+++
incubator/servicemix/trunk/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
Wed May 2 06:10:55 2007
@@ -74,6 +74,7 @@
protected SoapHelper soapHelper;
protected DeliveryChannel channel;
private Map methods;
+ private Protocol protocol;
public ProviderProcessor(HttpEndpoint endpoint) {
super(endpoint);
@@ -259,10 +260,14 @@
HostConfiguration host;
URI uri = new URI(locationURI, false);
if (uri.getScheme().equals("https")) {
- ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
- endpoint.getSsl(),
- endpoint.getKeystoreManager());
- Protocol protocol = new Protocol("https", sf, 443);
+ synchronized (this) {
+ if (protocol == null) {
+ ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
+ endpoint.getSsl(),
+ endpoint.getKeystoreManager());
+ protocol = new Protocol("https", sf, 443);
+ }
+ }
HttpHost httphost = new HttpHost(uri.getHost(), uri.getPort(),
protocol);
host = new HostConfiguration();
host.setHost(httphost);