use of com.jim.framework.rpc.codec.RpcEncoder in project jim-framework by jiangmin168168.
the class RpcServerInitializer method initChannel.
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
// logger.info("RpcServerInitializer.initChannel");
ChannelPipeline pipeline = socketChannel.pipeline();
;
Executor executor = this.rpcThreadPoolFactory.getThreadPool(ConstantConfig.DEFAULT_THREAD_POOL_NAME).getExecutor(1, 1);
pipeline.addLast(new RpcEncoder(RpcResponse.class)).addLast(new RpcDecoder(RpcRequest.class)).addLast(new IdleStateHandler(Constants.READER_TIME_SECONDS, 0, 0)).addLast(new ServerHeartbeatHandler()).addLast(new RpcServerInvoker(this.handlerMap, this.filterMap, executor));
}
use of com.jim.framework.rpc.codec.RpcEncoder in project jim-framework by jiangmin168168.
the class RpcClientInitializer method initChannel.
@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
ChannelPipeline cp = socketChannel.pipeline();
cp.addLast(new RpcEncoder(RpcRequest.class));
cp.addLast(new RpcDecoder(RpcResponse.class));
cp.addLast(new IdleStateHandler(0, 0, Constants.ALLIDLE_TIME_SECONDS));
cp.addLast(new ClientHeartbeatHandler());
cp.addLast(new RpcClientInvoker(this.getFilterMap()));
}
Aggregations