public class HttpExecutorFactory extends Object
| 构造器和说明 |
|---|
HttpExecutorFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
close()
释放httpClient
|
org.apache.http.impl.client.CloseableHttpClient |
getDefaultHttClient()
获取httpClient
|
static ExecutorService |
getDefaultThreadPool()
获取线程池
|
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient()
已过时。
|
HttpExecutor |
getHttpExecutor(BodyType bodyType)
获取http executor,如果没设置
httpClient,则自动创建一个http client |
HttpExecutor |
getHttpExecutor(BodyType bodyType,
org.apache.http.impl.client.CloseableHttpClient httpClient)
获取http executor
|
void |
setDefaultHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
释放
httpClient,并重新设置http client |
static ExecutorService |
setDefaultThreadPool(ExecutorService threadPool)
设置线程池
|
void |
setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
已过时。
|
public HttpExecutor getHttpExecutor(BodyType bodyType)
httpClient,则自动创建一个http clientpublic HttpExecutor getHttpExecutor(BodyType bodyType, org.apache.http.impl.client.CloseableHttpClient httpClient)
public static ExecutorService getDefaultThreadPool()
public static ExecutorService setDefaultThreadPool(ExecutorService threadPool)
@Deprecated public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
@Deprecated public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
public static void close()
public void setDefaultHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
httpClient,并重新设置http clientpublic org.apache.http.impl.client.CloseableHttpClient getDefaultHttClient()
Copyright © 2019. All rights reserved.