return new ChannelListener<StreamConnection>() {
@Override
public void handleEvent(final StreamConnection connection) {
MESSAGING_LOGGER.debugf("Switching to %s protocol for %s http-acceptor", HORNETQ_REMOTING, acceptorName);
SocketChannel channel = new WrappingXnioSocketChannel(connection);
RemotingService remotingService = hornetqServer.getRemotingService();
NettyAcceptor acceptor = (NettyAcceptor)remotingService.getAcceptor(acceptorName);
acceptor.transfer(channel);
connection.getSourceChannel().resumeReads();
}
};
}