Examples of ObjectDecoder


Examples of io.netty.handler.codec.serialization.ObjectDecoder

            };
        } else {
            return new DefaultChannelHandlerFactory() {
                @Override
                public ChannelHandler newChannelHandler() {
                    return new ObjectDecoder(ClassResolvers.weakCachingResolver(null));
                }
            };
        }
    }
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

             .handler(new ChannelInitializer<SocketChannel>() {
                @Override
                public void initChannel(SocketChannel ch) throws Exception {
                    ch.pipeline().addLast(
                            new ObjectEncoder(),
                            new ObjectDecoder(ClassResolvers.cacheDisabled(null)),
                            new ObjectEchoClientHandler(firstMessageSize));
                }
             });

            // Start the connection attempt.
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

             .childHandler(new ChannelInitializer<SocketChannel>() {
                @Override
                public void initChannel(SocketChannel ch) throws Exception {
                    ch.pipeline().addLast(
                            new ObjectEncoder(),
                            new ObjectDecoder(ClassResolvers.cacheDisabled(null)),
                            new ObjectEchoServerHandler());
                }
             });

            // Bind and start to accept incoming connections.
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

          if (sslContext != null) {
            pipeline.addLast(sslContext.newHandler(channel.alloc(), member.host(), member.port()));
          }
          pipeline.addLast(
              new ObjectEncoder(),
              new ObjectDecoder(ClassResolvers.softCachingConcurrentResolver(getClass().getClassLoader())),
              new TcpProtocolClientHandler(NettyTcpProtocolClient.this)
          );
        }
      });
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

        if (sslContext != null) {
          pipeline.addLast(sslContext.newHandler(channel.alloc()));
        }
        pipeline.addLast(
            new ObjectEncoder(),
            new ObjectDecoder(ClassResolvers.softCachingConcurrentResolver(getClass().getClassLoader())),
            new TcpProtocolServerHandler(NettyTcpProtocolServer.this)
        );
      }
    })
    .option(ChannelOption.SO_BACKLOG, 128);
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

        // Set up the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
                        new ObjectEncoder(),
                        new ObjectDecoder(),
                        new ObjectEchoClientHandler(firstMessageSize));
            }
        });

        // Start the connection attempt.
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

        // Set up the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                return Channels.pipeline(
                        new ObjectEncoder(),
                        new ObjectDecoder(),
                        new ObjectEchoServerHandler());
            }
        });

        // Bind and start to accept incoming connections.
View Full Code Here

Examples of io.netty.handler.codec.serialization.ObjectDecoder

        sb.childHandler(new ChannelInitializer<SocketChannel>() {
            @Override
            public void initChannel(SocketChannel sch) throws Exception {
                sch.pipeline().addLast(
                        new ObjectDecoder(ClassResolvers.cacheDisabled(getClass().getClassLoader())),
                        new ObjectEncoder(),
                        sh);
            }
        });

        cb.handler(new ChannelInitializer<SocketChannel>() {
            @Override
            public void initChannel(SocketChannel sch) throws Exception {
                sch.pipeline().addLast(
                        new ObjectDecoder(ClassResolvers.cacheDisabled(getClass().getClassLoader())),
                        new ObjectEncoder(),
                        ch);
            }
        });
View Full Code Here

Examples of org.jboss.netty.handler.codec.serialization.ObjectDecoder

    // Set up the pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      public ChannelPipeline getPipeline() throws Exception {
        return Channels.pipeline(
          new ObjectDecoder(ClassResolvers.cacheDisabled(getClass().getClassLoader())),
          new SimpleChannelHandler() {
            public void messageReceived(ChannelHandlerContext ctx,MessageEvent e) throws Exception {
              Date date = (Date)e.getMessage();
              slog("Hey Guys !  I got a date ! [" + date + "]");
              super.messageReceived(ctx, e);
View Full Code Here

Examples of org.jboss.netty.handler.codec.serialization.ObjectDecoder

      final ChannelFactory channelFactory = new NioClientSocketChannelFactory(bossPool, workerPool);
      ChannelPipelineFactory pipelineFactory = new ChannelPipelineFactory() {
        public ChannelPipeline getPipeline() throws Exception {
          return Channels.pipeline(
            new ObjectEncoder(),
            new ObjectDecoder(ClassResolvers.cacheDisabled(getClass().getClassLoader())),
            new ClientDateHandler()           
          );
        }
      };
      ClientBootstrap bootstrap = new ClientBootstrap(channelFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.