Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.DefaultChannelPipeline


      listener.disconnected();
    }
  }

  public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline pipeline = new DefaultChannelPipeline();

    SSLEngine engine = config.getServerSSLEngine();
      if (engine != null) {
          pipeline.addLast("ssl", new SslHandler(engine)); //$NON-NLS-1$
      }
      pipeline.addLast("decoder", new ObjectDecoder(1 << 20, classLoader, storageManager)); //$NON-NLS-1$
      pipeline.addLast("chunker", new ChunkedWriteHandler()); //$NON-NLS-1$
      pipeline.addLast("encoder", new ObjectEncoder()); //$NON-NLS-1$
      pipeline.addLast("handler", this); //$NON-NLS-1$
      return pipeline;
  }
View Full Code Here


  @Override
  protected SSLAwareChannelHandler createChannelPipelineFactory(final SSLConfiguration config, final StorageManager storageManager) {
    return new SSLAwareChannelHandler(this, config, Thread.currentThread().getContextClassLoader(), storageManager) {
      public ChannelPipeline getPipeline() throws Exception {
        ChannelPipeline pipeline = new DefaultChannelPipeline();

        SSLEngine engine = config.getServerSSLEngine();
          if (engine != null) {
              pipeline.addLast("ssl", new SslHandler(engine)); //$NON-NLS-1$
          }
          pipeline.addLast("odbcFrontendProtocol", new PgFrontendProtocol(1 << 20)); //$NON-NLS-1$
          pipeline.addLast("odbcBackendProtocol", new PgBackendProtocol(maxLobSize)); //$NON-NLS-1$
          pipeline.addLast("handler", this); //$NON-NLS-1$
          return pipeline;
      }     
    };
  }
View Full Code Here

    }

    @Override
    public ChannelPipeline getPipeline() throws Exception
    {
      ChannelPipeline pipeline = new DefaultChannelPipeline();
      pipeline.addLast("codec", new HttpClientCodec());
      pipeline.addLast("aggregator", new HttpChunkAggregator( 1024 * 1024));
      pipeline.addLast("responseHandler", _handler);
      return pipeline;
    }
View Full Code Here

    {
      @Override
      public ChannelPipeline getPipeline() throws Exception
      {
        // Create a default pipeline implementation.
        ChannelPipeline pipeline = new DefaultChannelPipeline();
        pipeline.addLast("decoder", new HttpRequestDecoder());
        pipeline.addLast("encoder", new HttpResponseEncoder());
        pipeline.addLast("deflater", new HttpContentCompressor());
        pipeline.addLast("handler", new HttpRequestHandler());
        return pipeline;
      }
View Full Code Here

             * Other protocols can use a faster static channel pipeline directly.
             */
            ChannelPipeline pipeline;
            if (protocol == ProtocolType.STOMP_WS)
            {
               pipeline = new DefaultChannelPipeline();
               for (Entry<String, ChannelHandler> handler : handlers.entrySet())
               {
                  pipeline.addLast(handler.getKey(), handler.getValue());
               }
            }
View Full Code Here

             * Other protocols can use a faster static channel pipeline directly.
             */
            ChannelPipeline pipeline;
            if (protocol == ProtocolType.STOMP_WS)
            {
               pipeline = new DefaultChannelPipeline();
               for (Entry<String, ChannelHandler> handler : handlers.entrySet())
               {
                  pipeline.addLast(handler.getKey(), handler.getValue());
               }
            }
View Full Code Here

            ChannelSink sink, ClientSocketChannelFactory clientSocketChannelFactory) {

        super(null, factory, pipeline, sink);
        this.clientSocketChannelFactory = clientSocketChannelFactory;

        DefaultChannelPipeline channelPipeline = new DefaultChannelPipeline();
        channelPipeline.addLast("DelimiterBasedFrameDecoder", handler);
        channelPipeline.addLast("servletHandler", servletHandler);
        channel = clientSocketChannelFactory.newChannel(channelPipeline);

        fireChannelOpen(this);
    }
View Full Code Here

    void connectAndSendHeaders(boolean reconnect, HttpTunnelAddress remoteAddress) {
        this.remoteAddress = remoteAddress;
        URI url = remoteAddress.getUri();
        if (reconnect) {
            DefaultChannelPipeline channelPipeline = new DefaultChannelPipeline();
            channelPipeline.addLast("DelimiterBasedFrameDecoder", handler);
            channelPipeline.addLast("servletHandler", servletHandler);
            channel = clientSocketChannelFactory.newChannel(channelPipeline);
        }
        SocketAddress connectAddress = new InetSocketAddress(url.getHost(), url.getPort());
        channel.connect(connectAddress);
        StringBuilder builder = new StringBuilder();
View Full Code Here

          *
          * @see WebSocketServerHandler#handleHttpRequest(ChannelHandlerContext, org.jboss.netty.handler.codec.http.HttpRequest)
          */
         public ChannelPipeline getPipeline() throws Exception
         {
            ChannelPipeline pipeline = new DefaultChannelPipeline();

            if (sslEnabled)
            {
               SSLEngine engine = context.createSSLEngine();

               engine.setUseClientMode(false);

               SslHandler handler = new SslHandler(engine);

               pipeline.addLast("ssl", handler);
            }

            if (httpEnabled)
            {
               pipeline.addLast("http-decoder", new HttpRequestDecoder());

               pipeline.addLast("http-encoder", new HttpResponseEncoder());

               pipeline.addLast("http-handler", new HttpAcceptorHandler(httpKeepAliveRunnable, httpResponseTime));
            }

            if (protocol == ProtocolType.CORE)
            {
               // Core protocol uses it's own optimised decoder
               pipeline.addLast("hornetq-decoder", new HornetQFrameDecoder2());
            }
            else if (protocol == ProtocolType.STOMP_WS)
            {
               pipeline.addLast("http-decoder", new HttpRequestDecoder());
               pipeline.addLast("http-aggregator", new HttpChunkAggregator(65536));
               pipeline.addLast("http-encoder", new HttpResponseEncoder());
               pipeline.addLast("hornetq-decoder", new HornetQFrameDecoder(decoder));
               pipeline.addLast("websocket-handler", new WebSocketServerHandler());
            }
            else
            {
               pipeline.addLast("hornetq-decoder", new HornetQFrameDecoder(decoder));
            }

            pipeline.addLast("handler", new HornetQServerChannelHandler(channelGroup, handler, new Listener()));

            return pipeline;
         }
      };
      bootstrap.setPipelineFactory(factory);
View Full Code Here

             * Other protocols can use a faster static channel pipeline directly.
             */
            ChannelPipeline pipeline;
            if (protocol == ProtocolType.STOMP_WS)
            {
               pipeline = new DefaultChannelPipeline();
               for (Entry<String, ChannelHandler> handler : handlers.entrySet())
               {
                  pipeline.addLast(handler.getKey(), handler.getValue());
               }
            }
View Full Code Here

TOP

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

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.