public ChannelHandler[] getServerChannelHandlers() {
PartitionRequestQueue queueOfPartitionQueues = new PartitionRequestQueue();
PartitionRequestServerHandler serverHandler =
new PartitionRequestServerHandler(
partitionProvider, taskEventPublisher, queueOfPartitionQueues);
return new ChannelHandler[] {
messageEncoder,
new NettyMessage.NettyMessageDecoder(),
serverHandler,
queueOfPartitionQueues
};
}
public ChannelHandler[] getClientChannelHandlers() {
NetworkClientHandler networkClientHandler = new CreditBasedPartitionRequestClientHandler();
return new ChannelHandler[] {
messageEncoder,
new NettyMessageClientDecoderDelegate(networkClientHandler),
networkClientHandler
};
}