Examples of ChannelPipelineFactory


Examples of org.jboss.netty.channel.ChannelPipelineFactory

                     ChannelFactory channelFactory, final ExecutionHandler executionHandler) {
      this.responder = responder;
      this.channelFactory = channelFactory;
      this.executionHandler = executionHandler;
      ServerBootstrap bootstrap = new ServerBootstrap(channelFactory);
      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

Examples of org.jboss.netty.channel.ChannelPipelineFactory

        // Initialize netty related structures
        ChannelFactory factory = new NioClientSocketChannelFactory(Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());
        bootstrap = new ClientBootstrap(factory);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() {
                ChannelPipeline p = Channels.pipeline();
                p.addLast("1", new LengthFieldPrepender(4));
                p.addLast("2", new ExceptionHandler());
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

        ChannelFactory factory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());

        bootstrap = new ServerBootstrap(factory);

        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() {
                ChannelPipeline p = Channels.pipeline();
                p.addLast("1", new LengthFieldBasedFrameDecoder(999999, 0, 4, 0, 4));
                p.addLast("2", new ChannelHandler(handoffQueue));
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

                new NioServerSocketChannelFactory(
                        Executors.newCachedThreadPool(),
                        Executors.newCachedThreadPool()));

        // Set up the pipeline factory.
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() throws Exception {
                ChannelPipeline pipeline = pipeline();
                pipeline.addLast("timeout", new IdleStateHandler(timer, 0, 0, 20));
                pipeline.addLast("nabaliveServerHandler", nabaliveServerHandler);
                return pipeline;
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

                                             ".log", Level.INFO);
    InternalLoggerFactory.setDefaultFactory(new Log4JLoggerFactory());

    _dummyServer = new SimpleTestServerConnection(ByteOrder.BIG_ENDIAN,
                                                  SimpleTestServerConnection.ServerType.NIO);
    _dummyServer.setPipelineFactory(new ChannelPipelineFactory() {
      @Override
      public ChannelPipeline getPipeline() throws Exception {
        return Channels.pipeline(new HttpServerCodec());
      }
    });
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

  static ChannelFuture createChannelFuture(final GenericHttpResponseHandler responseHandler, int port)
  {

    ClientBootstrap client = new ClientBootstrap(
        new NioClientSocketChannelFactory(BOSS_POOL, IO_POOL));
    client.setPipelineFactory(new ChannelPipelineFactory()
    {
      @Override
      public ChannelPipeline getPipeline() throws Exception
      {
        return Channels.pipeline(new LoggingHandler(InternalLogLevel.DEBUG),
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

    //initialize relays
    for (int relayN = 0; relayN < RELAY_PORT.length; ++relayN)
    {
      _dummyServer[relayN] = new SimpleTestServerConnection(_eventFactory.getByteOrder(),
                                                            SimpleTestServerConnection.ServerType.NIO);
      _dummyServer[relayN].setPipelineFactory(new ChannelPipelineFactory() {
          @Override
          public ChannelPipeline getPipeline() throws Exception {
              return Channels.pipeline(new LoggingHandler(InternalLogLevel.DEBUG),
                                       new HttpServerCodec(),
                                       new LoggingHandler(InternalLogLevel.DEBUG),
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

      else
      {
         context = null; // Unused
      }

      ChannelPipelineFactory factory = new ChannelPipelineFactory()
      {
         public ChannelPipeline getPipeline() throws Exception
         {
            List<ChannelHandler> handlers = new ArrayList<ChannelHandler>();
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

      if (context != null && useServlet)
      {
         bootstrap.setOption("sslContext", context);
      }

      bootstrap.setPipelineFactory(new ChannelPipelineFactory()
      {
         public ChannelPipeline getPipeline() throws Exception
         {
            List<ChannelHandler> handlers = new ArrayList<ChannelHandler>();
View Full Code Here

Examples of org.jboss.netty.channel.ChannelPipelineFactory

      if (context != null && useServlet)
      {
         bootstrap.setOption("sslContext", context);
      }

      bootstrap.setPipelineFactory(new ChannelPipelineFactory()
      {
         public ChannelPipeline getPipeline() throws Exception
         {
            List<ChannelHandler> handlers = new ArrayList<ChannelHandler>();
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.