| Package | Description |
|---|---|
| org.aoju.bus.http | |
| org.aoju.bus.http.accord | |
| org.aoju.bus.http.magic | |
| org.aoju.bus.http.metric | |
| org.aoju.bus.http.metric.http |
| Modifier and Type | Class and Description |
|---|---|
class |
RealCall
实际调用准备执行的请求
|
| Modifier and Type | Method and Description |
|---|---|
NewCall |
NewCall.clone() |
NewCall |
NewCall.Factory.newCall(Request request)
创建新的调用
|
NewCall |
Httpd.newCall(Request request) |
abstract NewCall |
Builder.newWebSocketCall(Httpd client,
Request request) |
| Modifier and Type | Method and Description |
|---|---|
void |
Callback.onFailure(NewCall call,
IOException ex)
当请求由于取消、连接问题或超时而无法执行时调用。
因为网络可能在交换期间失败,所以远程服务器可能在失败之前接受了请求.
|
void |
Callback.onResponse(NewCall call,
Response response)
当远程服务器成功返回HTTP响应时调用。回调可以继续使用
Response.body读取响应体响应仍然是活动的
直到它的响应体是closed 回调的接收者可以使用另一个线程上的响应体
注意,传输层的成功(接收HTTP响应代码、报头和正文)不一定表示应用程序层的
成功:response可能仍然表示不满意的HTTP响应代码,如404或500 |
abstract StreamAllocation |
Builder.streamAllocation(NewCall call) |
abstract IOException |
Builder.timeoutExit(NewCall call,
IOException e) |
| Modifier and Type | Field and Description |
|---|---|
NewCall |
StreamAllocation.call |
| Modifier and Type | Method and Description |
|---|---|
void |
RealConnection.connect(int connectTimeout,
int readTimeout,
int writeTimeout,
int pingIntervalMillis,
boolean connectionRetryEnabled,
NewCall call,
EventListener eventListener) |
| Constructor and Description |
|---|
RouteSelector(Address address,
RouteDatabase routeDatabase,
NewCall call,
EventListener eventListener) |
StreamAllocation(ConnectionPool connectionPool,
Address address,
NewCall call,
EventListener eventListener,
Object callStackTrace) |
| Modifier and Type | Method and Description |
|---|---|
NewCall |
RequestCall.buildCall(AbsCallback absCallback) |
NewCall |
RequestCall.getNewCall() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
AbsCallback.onFailure(NewCall newCall,
Exception e,
int id) |
void |
StringCallback.onResponse(NewCall newCall,
HttpResponse response,
int id) |
void |
FileCallback.onResponse(NewCall newCall,
HttpResponse response,
int id) |
abstract void |
AbsCallback.onResponse(NewCall newCall,
HttpResponse httpResponse,
int id) |
void |
FileCallback.onSuccess(NewCall newCall,
File file,
int id) |
void |
FileCallback.onSuccess(NewCall newCall,
InputStream fileStream,
int id) |
void |
StringCallback.onSuccess(NewCall newCall,
String response,
int id) |
| Modifier and Type | Method and Description |
|---|---|
NewCall |
Interceptor.Chain.call() |
| Modifier and Type | Method and Description |
|---|---|
List<NewCall> |
Dispatcher.queuedCalls() |
List<NewCall> |
Dispatcher.runningCalls() |
| Modifier and Type | Method and Description |
|---|---|
void |
EventListener.callEnd(NewCall call)
在调用完全结束后立即调用。这包括调用方延迟消耗响应体.
|
void |
EventListener.callFailed(NewCall call,
IOException ioe)
永久失败时调用.
|
void |
EventListener.callStart(NewCall call)
在调用进入队列或由客户端执行时立即调用。在线程或流限制的情况下,这个调用可能在处理请求
开始之前就已经执行了 对于单个
NewCall只调用一次。不同路由或重定向的重试将在
单个callStart和EventListener.callEnd(org.aoju.bus.http.NewCall)/EventListener.callFailed(org.aoju.bus.http.NewCall, java.io.IOException)对的范围内处理。 |
void |
EventListener.connectEnd(NewCall call,
InetSocketAddress inetSocketAddress,
Proxy proxy,
Protocol protocol)
在尝试套接字连接后立即调用.
|
void |
EventListener.connectFailed(NewCall call,
InetSocketAddress inetSocketAddress,
Proxy proxy,
Protocol protocol,
IOException ioe)
连接尝试失败时调用。如果有进一步的路由可用并且启用了故障恢复,则此故障不是终端.
|
void |
EventListener.connectionAcquired(NewCall call,
Connection connection)
为
call获取连接后调用. |
void |
EventListener.connectionReleased(NewCall call,
Connection connection)
在为
call释放连接后调用. |
void |
EventListener.connectStart(NewCall call,
InetSocketAddress inetSocketAddress,
Proxy proxy)
仅在初始化套接字连接之前调用.
|
EventListener |
EventListener.Factory.create(NewCall call)
为特定的
NewCall创建EventListener的实例。
返回的EventListener实例将在call的生命周期中使用
此方法在创建call之后调用。查看# newCall(请求)
对实现来说,在这个方法的call实例上发出任何变化操作都是错误的 |
void |
EventListener.dnsEnd(NewCall call,
String domainName,
List<InetAddress> inetAddressList)
在DNS查找后立即调用.
|
void |
EventListener.dnsStart(NewCall call,
String domainName)
仅在DNS查找之前调用。看到
#查找(String) |
void |
EventListener.requestBodyEnd(NewCall call,
long byteCount)
在发送请求主体后立即调用
此方法总是在
EventListener.requestBodyStart(NewCall)之后调用 |
void |
EventListener.requestBodyStart(NewCall call)
仅在发送请求主体之前调用。只有在请求允许并有一个请求体要发送时才会被调用吗.
|
void |
EventListener.requestHeadersEnd(NewCall call,
Request request)
发送请求头后立即调用.
|
void |
EventListener.requestHeadersStart(NewCall call)
仅在发送请求头之前调用.
|
void |
EventListener.responseBodyEnd(NewCall call,
long byteCount)
在接收到响应体并完成读取后立即调用.
|
void |
EventListener.responseBodyStart(NewCall call)
仅在接收响应主体之前调用.
|
void |
EventListener.responseHeadersEnd(NewCall call,
Response response)
在接收响应标头后立即调用
这个方法总是在
EventListener.responseHeadersStart(org.aoju.bus.http.NewCall)之后调用 |
void |
EventListener.responseHeadersStart(NewCall call)
仅在接收响应标头之前调用.
|
void |
EventListener.secureConnectEnd(NewCall call,
Handshake handshake)
尝试TLS连接后立即调用.
|
void |
EventListener.secureConnectStart(NewCall call)
在启动TLS连接之前调用.
|
| Modifier and Type | Method and Description |
|---|---|
NewCall |
RealInterceptorChain.call() |
| Constructor and Description |
|---|
RealInterceptorChain(List<Interceptor> interceptors,
StreamAllocation streamAllocation,
HttpCodec httpCodec,
RealConnection connection,
int index,
Request request,
NewCall call,
EventListener eventListener,
int connectTimeout,
int readTimeout,
int writeTimeout) |
Copyright © 2019. All rights reserved.