@Override
public void operationComplete(ChannelFuture future) throws Exception {
Channel channel = future.getChannel();
Connection connection = new Connection(NettyConnectionManager.this, channel, PostgresqlConnectFuture.this);
ConnectionState state = connection.getConnectionState();
ProtocolHandler protocolHandler = new ProtocolHandler(NettyConnectionManager.this);
ChannelPipeline pipeline = channel.getPipeline();
pipeline.addLast(ENCODER, new Encoder(state));
pipeline.addLast(DECODER, new Decoder(state));
pipeline.addLast(QUEUE_HANDLER, new Handler(connection, protocolHandler));
protocolHandler.connectionOpened(connection);
}
});
}