美文网首页
HTTP异步客户端HttpAsyncClient

HTTP异步客户端HttpAsyncClient

作者: 无量散人 | 来源:发表于2018-06-09 11:44 被阅读524次
    • 接口
    /**
     * 此接口只代表HTTP请求执行的最基本的契约。它对请求执行过程不施
     * 加任何限制或特定细节,并将状态管理、身份验证和重定向处理的细节
     * 留给子类实现。
     */
    public interface HttpAsyncClient {
    
        /**
         * 使用给定上下文启动异步HTTP请求execution。
         */
        <T> Future<T> execute(
                HttpAsyncRequestProducer requestProducer,
                HttpAsyncResponseConsumer<T> responseConsumer,
                HttpContext context,
                FutureCallback<T> callback);
    
        /**
         * 使用默认上下文启动异步HTTP请求execution
         */
        <T> Future<T> execute(
                HttpAsyncRequestProducer requestProducer,
                HttpAsyncResponseConsumer<T> responseConsumer,
                FutureCallback<T> callback);
    
        /**
         * 启动给定目标的异步HTTP请求execution(指定上线文)
         */
        Future<HttpResponse> execute(
                HttpHost target, HttpRequest request, HttpContext context,
                FutureCallback<HttpResponse> callback);
    
        /**
         * 启动给定目标的异步HTTP请求execution
         */
        Future<HttpResponse> execute(
                HttpHost target, HttpRequest request,
                FutureCallback<HttpResponse> callback);
    
        /**
         * 使用给定上下文启动异步HTTP请求execution
         */
        Future<HttpResponse> execute(
                HttpUriRequest request, HttpContext context,
                FutureCallback<HttpResponse> callback);
    
        /**
         * 启动异步HTTP请求execution
         */
        Future<HttpResponse> execute(
                HttpUriRequest request,
                FutureCallback<HttpResponse> callback);
    
    }
    

    • ** 实现类 **


      MinimalHttpAsyncClient继承关系图.png
    MinimalHttpAsyncClient继承关系图.png

    相关文章

      网友评论

          本文标题:HTTP异步客户端HttpAsyncClient

          本文链接:https://www.haomeiwen.com/subject/bzsgnxtx.html