Package io.netty.channel

Examples of io.netty.channel.Channel.pipeline()


      future.awaitUninterruptibly();

      if (future.isSuccess())
      {
         final Channel ch = future.channel();
         SslHandler sslHandler = ch.pipeline().get(SslHandler.class);
         if (sslHandler != null)
         {
            Future<Channel> handshakeFuture = sslHandler.handshakeFuture();
            if (handshakeFuture.awaitUninterruptibly(30000))
            {
View Full Code Here


            Future<Channel> handshakeFuture = sslHandler.handshakeFuture();
            if (handshakeFuture.awaitUninterruptibly(30000))
            {
               if (handshakeFuture.isSuccess())
               {
                  ChannelPipeline channelPipeline = ch.pipeline();
                  HornetQChannelHandler channelHandler = channelPipeline.get(HornetQChannelHandler.class);
                  channelHandler.active = true;
               }
               else
               {
View Full Code Here

            {
               // Send a HTTP GET + Upgrade request that will be handled by the http-upgrade handler.
               try
               {
                  //get this first incase it removes itself
                  HttpUpgradeHandler httpUpgradeHandler = (HttpUpgradeHandler) ch.pipeline().get("http-upgrade");
                  URI uri = new URI("http", null, host, port, null, null, null);
                  HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.getRawPath());
                  request.headers().set(HttpHeaders.Names.HOST, host);
                  request.headers().set(HttpHeaders.Names.UPGRADE, HORNETQ_REMOTING);
                  request.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.UPGRADE);
View Full Code Here

                  return null;
               }
            }
            else
            {
               ChannelPipeline channelPipeline = ch.pipeline();
               HornetQChannelHandler channelHandler = channelPipeline.get(HornetQChannelHandler.class);
               channelHandler.active = true;
            }
         }
View Full Code Here

        }

        EventLoopGroup eventLoopGroup = process.getEventLoop().getEventLoopGroup();
        Channel channel = NioOutputStreamChannel.create(process, out);
        channel.config().setAutoRead(false);
        channel.pipeline().addLast( new DataEventHandler( process, handle ));
        eventLoopGroup.register(channel);

        return channel.newSucceededFuture();
    }
}
View Full Code Here

            InputStream in = System.in;
            EventLoopGroup eventLoopGroup = process.getEventLoop().getEventLoopGroup();

            Channel channel = NioInputStreamChannel.create(process, in);
            channel.config().setAutoRead(false);
            channel.pipeline().addLast( new DataEventHandler( process, handle ) );
            eventLoopGroup.register(channel);

            return channel.newSucceededFuture();
        }
View Full Code Here

                logger.debug("Using TLSv1.1");
            }

            engine.setUseClientMode(true);
            RiakSecurityDecoder decoder = new RiakSecurityDecoder(engine, username, password);
            c.pipeline().addFirst(decoder);
               
            try
            {
                DefaultPromise<Void> promise = decoder.getPromise();
                promise.await();
View Full Code Here

            // an exception if a connection can't be made.
            Channel c = doGetConnection();

            Promise<RiakMessage> promise;
           
            if (c.pipeline().names().contains(Constants.SSL_HANDLER))
            {
                c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            else
            {
View Full Code Here

            Promise<RiakMessage> promise;
           
            if (c.pipeline().names().contains(Constants.SSL_HANDLER))
            {
                c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            else
            {
                c.pipeline().addBefore(Constants.MESSAGE_CODEC, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
View Full Code Here

            {
                c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            else
            {
                c.pipeline().addBefore(Constants.MESSAGE_CODEC, Constants.HEALTHCHECK_CODEC, healthCheck);
            }
            logger.debug("healthCheck added to pipeline.");
           
            try
            {
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.