package com.xqbase.baiji.transport.http.client;

import com.xqbase.baiji.m2.Request;
import com.xqbase.baiji.m2.RequestContext;
import com.xqbase.baiji.m2.Response;
import com.xqbase.baiji.transport.bridge.client.TransportClient;
import com.xqbase.baiji.transport.bridge.common.TransportCallback;

/**
 * HttpClient based on Netty.
 *
 * @author Tony He
 */
public class HttpNettyClient implements TransportClient {

    private final ChannelPoolManager poolManager;

    public HttpNettyClient(ChannelPoolManager poolManager) {
        this.poolManager = poolManager;
    }

    @Override
    public void request(Request request, RequestContext requestContext, TransportCallback<Response> callback) {
    }
}

@@ -196,104 +196,621 @@
 ort.
-bridge.client.TransportClient;%0Aimport com.xqbase.baiji.transport.bridge.common.TransportCallback
+apool.AsyncPool;%0Aimport com.xqbase.baiji.transport.apool.impl.AsyncPoolImpl;%0Aimport com.xqbase.baiji.transport.bridge.client.TransportClient;%0Aimport com.xqbase.baiji.transport.bridge.common.TransportCallback;%0Aimport io.netty.bootstrap.Bootstrap;%0Aimport io.netty.channel.Channel;%0Aimport io.netty.channel.group.ChannelGroup;%0Aimport io.netty.channel.group.DefaultChannelGroup;%0Aimport io.netty.util.concurrent.GlobalEventExecutor;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.net.SocketAddress;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.ScheduledExecutorService
 ;%0A%0A/
@@ -927,16 +927,106 @@
 ient %7B%0A%0A
+    private static final Logger LOGGER = LoggerFactory.getLogger(HttpNettyClient.class);%0A%0A
     priv
@@ -1071,242 +1071,1658 @@
 er;%0A
-%0A
     p
-ublic HttpNettyClient(ChannelPoolManager poolManager) %7B%0A        this.poolManager = poolManager;%0A    %7D%0A%0A    @Override%0A    public void request(Request request, RequestContext requestContext, TransportCallback%3CResponse%3E callback) %7B
+rivate final ChannelGroup allChannels = new DefaultChannelGroup(%22Transport Channels%22, GlobalEventExecutor.INSTANCE);%0A%0A    private final ScheduledExecutorService timeoutSchedule;%0A    private final ExecutorService callbackExecutor;%0A%0A    private final int requestTimeout;%0A%0A    public HttpNettyClient(ScheduledExecutorService timeoutSchedule,%0A                           ExecutorService callbackExecutor,%0A                           int requestTimeout,%0A                           int idleTimeout,%0A                           int poolSize,%0A                           int maxWaiters,%0A                           ) %7B%0A%0A    %7D%0A%0A    @Override%0A    public void request(Request request, RequestContext requestContext, TransportCallback%3CResponse%3E callback) %7B%0A    %7D%0A%0A    private class ChannelPoolFactoryImpl implements ChannelPoolFactory %7B%0A%0A        private final Bootstrap clientBootstrap;%0A        private final int maxSize;%0A        private final int minSize;%0A        private final long idleTimeout;%0A        private final int maxWaiterSize;%0A        private final AsyncPoolImpl.Strategy strategy;%0A%0A        private ChannelPoolFactoryImpl(Bootstrap clientBootstrap, int maxSize, int minSize,%0A                    long idleTimeout, int maxWaiterSize, AsyncPoolImpl.Strategy strategy) %7B%0A            this.clientBootstrap = clientBootstrap;%0A            this.maxSize = maxSize;%0A            this.minSize = minSize;%0A            this.idleTimeout = idleTimeout;%0A            this.maxWaiterSize = maxWaiterSize;%0A            this.strategy = strategy;%0A        %7D%0A%0A        @Override%0A        public AsyncPool%3CChannel%3E getPool(SocketAddress address) %7B%0A            return null;%0A        %7D
 %0A   

update the HttpNettyClient...