return;
}
String protocolToUse = null;
for (String protocol : protocolMap.keySet())
{
ProtocolManager protocolManager = protocolMap.get(protocol);
if(protocolManager.isProtocol(in.copy(0, 8).array()))
{
protocolToUse = protocol;
break;
}
}
//if we get here we assume we use the core protocol as we match nothing else
if(protocolToUse == null)
{
protocolToUse = HornetQClient.DEFAULT_CORE_PROTOCOL;
}
ProtocolManager protocolManagerToUse = protocolMap.get(protocolToUse);
ConnectionCreator channelHandler = nettyAcceptor.createConnectionCreator();
ChannelPipeline pipeline = ctx.pipeline();
protocolManagerToUse.addChannelHandlers(pipeline);
pipeline.addLast("handler", channelHandler);
NettyServerConnection connection = channelHandler.createConnection(ctx, protocolToUse, httpEnabled);
protocolManagerToUse.handshake(connection, new ChannelBufferWrapper(in));
pipeline.remove(this);
ctx.flush();
}