ProxyRelatedResourceManager implements ResourceManager { @Override public SimpleKeyedObjectPool<Endpoint, NettyClient> getKeyedObjectPool() { if(keyedObjectPool == null) { synchronized (this) { if(keyedObjectPool == null) { createKeyedObjectPool(); } } } return keyedObjectPool; }  @Override NettySslHandlerFactory getClientSslHandlerFactory(); @Override NettySslHandlerFactory getServerSslHandlerFactory(); @Override ScheduledExecutorService getGlobalSharedScheduled(); @Override ProxyConfig getProxyConfig(); @Override SimpleKeyedObjectPool<Endpoint, NettyClient> getKeyedObjectPool(); @Override ProxyEndpointSelector createProxyEndpointSelector(ProxyConnectProtocol protocol);  }
@Ignore @Test public void testGetKeyedObjectPool() throws Exception { Server server = startEchoServer(); SimpleKeyedObjectPool<Endpoint, NettyClient> keyedObjectPool = resourceManager.getKeyedObjectPool(); SimpleObjectPool<NettyClient> objectPool = keyedObjectPool.getKeyPool(localhostEndpoint(server.getPort())); NettyClient nettyClient = objectPool.borrowObject(); nettyClient.sendRequest(Unpooled.copiedBuffer("hello world".getBytes()), new ByteBufReceiver() { @Override public RECEIVER_RESULT receive(Channel channel, ByteBuf byteBuf) { logger.info("[receive]{}", ByteBufUtils.readToString(byteBuf)); return null; } @Override public void clientClosed(NettyClient nettyClient) { } }); sleep(1000 * 10); }