BAEL-768 Introduction to Netty (#1933)

* BAEL-748 quick guide to @Value

* BAEL-748 changes from review

* BAEL-748 inject comma-separated values into array

* BAEL-768 Introduction to Netty

* BAEL-768 remove commented code
This commit is contained in:
Anton
2017-06-07 08:52:23 +03:00
committed by Grzegorz Piwowarek
parent 4c88eebd55
commit 4732baccab
12 changed files with 291 additions and 0 deletions
@@ -0,0 +1,19 @@
package com.baeldung.netty;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
public class ProcessingHandler extends ChannelInboundHandlerAdapter {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
RequestData requestData = (RequestData) msg;
ResponseData responseData = new ResponseData();
responseData.setIntValue(requestData.getIntValue() * 2);
ChannelFuture future = ctx.writeAndFlush(responseData);
future.addListener(ChannelFutureListener.CLOSE);
System.out.println(requestData);
}
}