All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.frameworkset.spi.remote.http.HttpConnectionKeepAliveStrategy Maven / Gradle / Ivy

There is a newer version: 6.3.2
Show newest version
package org.frameworkset.spi.remote.http;

import org.apache.http.HttpResponse;
import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
import org.apache.http.protocol.HttpContext;

public class HttpConnectionKeepAliveStrategy extends DefaultConnectionKeepAliveStrategy{
	private long keepAlive ;
	public HttpConnectionKeepAliveStrategy(long keepAlive) {
		this.keepAlive = keepAlive;
	}
	
	 @Override  
     public long getKeepAliveDuration(HttpResponse response, HttpContext context) {  
         long keepAlive = super.getKeepAliveDuration(response, context);  
         if (keepAlive == -1) {  
             keepAlive = this.keepAlive;  
         }  
         return keepAlive;  
     }  

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy