Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelPipelineFactory


        nettyClientBootstrapOptions.get(NETTY_CONNECT_TIMEOUT_OPTION);
    bootstrap = new ClientBootstrap(channelFactory);
    remoteAddr = addr;

    // Configure the event pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline p = Channels.pipeline();
        p.addLast("frameDecoder", new NettyFrameDecoder());
        p.addLast("frameEncoder", new NettyFrameEncoder());
View Full Code Here


  @Override
  public void start() {
    // setup Netty server
    ConnectionlessBootstrap serverBootstrap = new ConnectionlessBootstrap
        (new OioDatagramChannelFactory(Executors.newCachedThreadPool()));
    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      public ChannelPipeline getPipeline() {
       return Channels.pipeline(new syslogHandler());
      }
     });
View Full Code Here

  public void start() {
    ChannelFactory factory = new NioServerSocketChannelFactory(
        Executors.newCachedThreadPool(), Executors.newCachedThreadPool());

    ServerBootstrap serverBootstrap = new ServerBootstrap(factory);
    serverBootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      public ChannelPipeline getPipeline() {
        return Channels.pipeline(new syslogTcpHandler());
      }
    });
View Full Code Here

    this.workerCount = workercount;
    this.pipelineFactory = getPipelineFactory();
  }

  public ChannelPipelineFactory getPipelineFactory() {
    return new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() {
        return Channels.pipeline(new RpcFrameDecoder(),
            new SimpleTcpServerHandler(rpcProgram));
      }
View Full Code Here

  private void startTCPServer() {
    SimpleTcpServer tcpServer = new SimpleTcpServer(Nfs3Constant.PORT,
        rpcProgram, 0) {
      @Override
      public ChannelPipelineFactory getPipelineFactory() {
        return new ChannelPipelineFactory() {
          @Override
          public ChannelPipeline getPipeline() {
            return Channels.pipeline(new RpcFrameDecoder(),
                new SimpleTcpServerHandler(rpcProgram));
          }
View Full Code Here

      super(host, port, request, oneShot);
    }

    @Override
    protected ChannelPipelineFactory setPipelineFactory() {
      this.pipelineFactory = new ChannelPipelineFactory() {
        public ChannelPipeline getPipeline() {
          return Channels.pipeline(new RpcFrameDecoder(), new WriteHandler(
              request));
        }
      };
View Full Code Here

  public SimpleUdpServer(int port, RpcProgram program, int workerCount) {
    this.port = port;
    this.rpcProgram = program;
    this.workerCount = workerCount;
    this.pipelineFactory = new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() {
        return Channels.pipeline(new SimpleUdpServerHandler(rpcProgram));
      }
    };
View Full Code Here

    this.request = request;
    this.oneShot = oneShot;
  }
 
  protected ChannelPipelineFactory setPipelineFactory() {
    this.pipelineFactory = new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() {
        return Channels.pipeline(new RpcFrameDecoder(),
            new SimpleTcpClientHandler(request));
      }
View Full Code Here

        if (started) throw new IllegalStateException("Server running already");

        if (addresses.isEmpty()) throw new RuntimeException("Please specify at least on socketaddress to which the server should get bound!");

        bootstrap = new ServerBootstrap(createSocketChannelFactory());
        ChannelPipelineFactory factory = createPipelineFactory(channels);
       
        // Configure the pipeline factory.
        bootstrap.setPipelineFactory(factory);
        configureBootstrap(bootstrap);
       
View Full Code Here

    this.channelFactory = channelFactory;
    bootstrap = new ClientBootstrap(channelFactory);
    remoteAddr = addr;

    // Configure the event pipeline factory.
    bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline p = Channels.pipeline();
        p.addLast("frameDecoder", new NettyFrameDecoder());
        p.addLast("frameEncoder", new NettyFrameEncoder());
View Full Code Here

TOP

Related Classes of org.jboss.netty.channel.ChannelPipelineFactory

Copyright © 2018 www.massapicom. 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.