com.turbospaces.http.HttpClientDisposableBean Maven / Gradle / Ivy
package com.turbospaces.http;
import java.util.Objects;
import javax.inject.Inject;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.DisposableBean;
public class HttpClientDisposableBean implements DisposableBean {
private final CloseableHttpClient client;
@Inject
public HttpClientDisposableBean(CloseableHttpClient channel) {
this.client = Objects.requireNonNull( channel );
}
@Override
public void destroy() throws Exception {
client.close();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy