Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.ChannelPipeline


      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

        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            @Override
            public ChannelPipeline getPipeline() throws Exception {
                long timestamp = timestamp();
                Object id = nextId();
                ChannelPipeline pipeline = pipeline();
                pipeline.addLast("decoder", new HttpRequestDecoder());
                pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
                pipeline.addLast("encoder", new HttpResponseEncoder());
                pipeline.addLast("handler", new NettyHttpChannelHandler(
                        executor, handlers, id, timestamp, exceptionHandler, ioExceptionHandler));
                return pipeline;
            }
        });
View Full Code Here

            adjustPipelineToHixie(ctx);
        }
    }

    protected void adjustPipelineToHixie(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getChannel().getPipeline();
        p.remove("aggregator");
        p.replace("decoder", "wsdecoder", new WebSocketFrameDecoder());
        p.replace("handler", "wshandler", this);
        p.replace("encoder", "wsencoder", new WebSocketFrameEncoder());
    }
View Full Code Here

        p.replace("handler", "wshandler", this);
        p.replace("encoder", "wsencoder", new WebSocketFrameEncoder());
    }

    protected void adjustPipelineToHybi(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getChannel().getPipeline();
        p.remove("aggregator");
        p.replace("decoder", "wsdecoder", new Hybi10WebSocketFrameDecoder());
        p.replace("handler", "wshandler", this);
        p.replace("encoder", "wsencoder", new Hybi10WebSocketFrameEncoder());
    }
View Full Code Here

        res.addHeader("Cache-Control", "no-cache");
        res.setChunked(false);
    }

    protected void adjustPipeline(ChannelHandlerContext ctx) {
        ChannelPipeline p = ctx.getChannel().getPipeline();
        p.remove("aggregator");
        p.replace("handler", "ssehandler", this);
//        ctx.getChannel().write("");
    }
View Full Code Here

*/
public class FactorialServerPipelineFactory implements
        ChannelPipelineFactory {

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

        // Enable stream compression (you can remove these two if unnecessary)
        pipeline.addLast("deflater", new ZlibEncoder(ZlibWrapper.GZIP));
        pipeline.addLast("inflater", new ZlibDecoder(ZlibWrapper.GZIP));

        // Add the number codec first,
        pipeline.addLast("decoder", new BigIntegerDecoder());
        pipeline.addLast("encoder", new NumberEncoder());

        // and then business logic.
        // Please note we create a handler for every new channel
        // because it has stateful properties.
        pipeline.addLast("handler", new FactorialServerHandler());

        return pipeline;
    }
View Full Code Here

    _executor = executor;
  }
 
  public ChannelPipeline getPipeline() throws Exception
  {
    ChannelPipeline pipeline = new MixinPipeline();
        pipeline.addLast("inputStream", new InputStreamDecoder());
        //pipeline.addLast("logger2",new OutLogger("2"));
        pipeline.addLast("outputStream", new OutputStreamEncoder());
        pipeline.addLast("callDecoder", new PullInputStreamConsumer(new HessianRPCCallDecoder(_serializerFactory), _executor ));
        pipeline.addLast("replyEncoder", new HessianRPCReplyEncoder(_serializerFactory));
    pipeline.addLast("outputProducer", new OutputProducer(_executor));
        //pipeline.addLast("logger3",new OutLogger("3"));
        HessianRPCServiceHandler factory =  new HessianRPCServiceHandler(_executor);
    ArrayList servers = MBeanServerFactory.findMBeanServer(null);
    MBeanServer server = null;
      if (servers != null && servers.size() > 0)
        server = (MBeanServer) servers.get(0);
      if (server == null)
        server = MBeanServerFactory.createMBeanServer();
   

        //factory.addService("default", new ContinuationService(new ContinuationHalloWorldService(), HelloWorldServiceInterface.class, factory, _executor));
        factory.addService("default", new ImmediateInvokeService(server, MBeanServerConnection.class, factory));
        pipeline.addLast("hessianRPCServer", factory);
       
        //bootstrap.getPipeline().addLast("logger4",new OutLogger("4"));
        return pipeline;
  }
View Full Code Here

    _mixinFactory = mixinFactory;
  }
 
  public ChannelPipeline getPipeline() throws Exception
 
    ChannelPipeline pipeline = pipeline(); // Note the static import.
    pipeline.addLast("logger",new OutLogger("1"));
    pipeline.addLast("sessionFilter", new ServerSessionFilter(_mixinFactory));
    return pipeline;
  }
View Full Code Here

 

 
  public ChannelPipeline getPipeline() throws Exception
  {
        ChannelPipeline pipeline = new MixinPipeline();
        // InputStreamDecoder returns an input stream and calls the next handler in a separate thread

        pipeline.addLast("inputStream", new InputStreamDecoder());

        //pipeline.addLast("logger2",new OutLogger1("2"));
        pipeline.addLast("outputStream", new OutputStreamEncoder());
       
        pipeline.addLast("hessianReplyDecoder", new PullInputStreamConsumer(new HessianRPCReplyDecoder(_factory, _serializerFactory), _executor));
        pipeline.addLast("hessianCallEncoder", new HessianRPCCallEncoder(_serializerFactory));
    pipeline.addLast("outputProducer", new OutputProducer(_executor));
        //pipeline.addLast("logger3",new OutLogger("3"));
        pipeline.addLast("hessianHandler", _factory);
       
        return pipeline;

  }
View Full Code Here

TOP

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

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.