/** * Creates a new instance with the specified parameters. */ protected RtspMessageDecoder(int maxInitialLineLength, int maxHeaderSize, int maxContentLength) { super(maxInitialLineLength, maxHeaderSize, maxContentLength * 2); aggregator = new DecoderEmbedder<HttpMessage>(new HttpChunkAggregator(maxContentLength)); }
/** * Add all {@link ChannelHandler}'s that are needed for HTTP. */ protected void addHttpHandlers(ChannelHandlerContext ctx) { ChannelPipeline pipeline = ctx.getPipeline(); pipeline.addLast("httpRequestDecoder", new HttpRequestDecoder()); pipeline.addLast("httpResponseEncoder", new HttpResponseEncoder()); pipeline.addLast("httpChunkAggregator", new HttpChunkAggregator(maxHttpContentLength)); pipeline.addLast("httpRequestHandler", createHttpRequestHandlerForHttp()); }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_AGGREGATE_SIZE)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new CoordinatorAdminRequestHandler(storeClientConfigs)); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("connectionStats", connectionStatsHandler); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(maxHttpContentLength)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new RestServerRequestHandler(storeRepository)); pipeline.addLast("storageExecutionHandler", storageExecutionHandler); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("connectionStats", connectionStatsHandler); pipeline.addLast("decoder", new HttpRequestDecoder(this.coordinatorConfig.getHttpMessageDecoderMaxInitialLength(), this.coordinatorConfig.getHttpMessageDecoderMaxHeaderSize(), this.coordinatorConfig.getHttpMessageDecoderMaxChunkSize())); pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new RestCoordinatorRequestHandler(fatClientMap)); pipeline.addLast("coordinatorExecutionHandler", coordinatorExecutionHandler); return pipeline; } }
@Override public boolean applyProtocol(ChannelBuffer buffer, ChannelPipeline pipeline) { boolean isThisProtocol = false; final int magic1 = buffer.getUnsignedByte(buffer.readerIndex()); final int magic2 = buffer.getUnsignedByte(buffer.readerIndex() + 1); if (isHttp(magic1, magic2)) { pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", new WebSocketServerProtocolHandler("/jetsocket")); pipeline.addLast(LOGIN_HANDLER_NAME, webSocketLoginHandler); isThisProtocol = true; } return isThisProtocol; }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); if (sslFactory != null) { pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine())); } pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("chunking", new ChunkedWriteHandler()); pipeline.addLast("shuffle", SHUFFLE); pipeline.addLast("idle", idleStateHandler); pipeline.addLast(TIMEOUT_HANDLER, new TimeoutHandler()); return pipeline; // TODO factor security manager into pipeline // TODO factor out encode/decode to permit binary shuffle // TODO factor out decode of index to permit alt. models }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); // Add custom channel handlers for (ChannelHandler channelHandler : additionalChannelHandlers) { pipeline.addLast(channelHandler.getClass().getSimpleName(), channelHandler); } pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(maxRequestSize)); pipeline.addLast("resteasyDecoder", resteasyDecoder); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("resteasyEncoder", resteasyEncoder); if (executionHandler != null) { pipeline.addLast("executionHandler", executionHandler); } pipeline.addLast("handler", resteasyRequestHandler); return pipeline; }
public class WebSocketServerPipelineFactory implements ChannelPipelineFactory { public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", new YourBusinessHandler()); return pipeline; }
pipeline.addLast("decoder", new HttpRequestDecoder(4096, 4096, 100*1024*1024)); pipeline.addLast("aggregator", new HttpChunkAggregator(100*1024*1024)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("hndlr", new FrontendHandler(...));
@Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline( new HttpRequestDecoder(), new HttpChunkAggregator(1 << 16), new HttpResponseEncoder(), new ChunkedWriteHandler(), shuffleHandler); } }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("requestDecoder", new HttpRequestDecoder()); pipeline.addLast("responseEncoder", new HttpResponseEncoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); pipeline.addLast("thriftHandler", (ChannelHandler) handler); return pipeline; }
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", socketHandler); return pipeline; } }
@Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new HttpRequestDecoder(), new HttpChunkAggregator(65536), new HttpResponseEncoder(), new CredentialsLogicHandler(token, url.toString())); } });
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); // Uncomment the following line if you want HTTPS //SSLEngine engine = SecureChatSslContextFactory.getServerContext().createSSLEngine(); //engine.setUseClientMode(false); //pipeline.addLast("ssl", new SslHandler(engine)); pipeline.addLast("decoder", new HttpRequestDecoder()); // Uncomment the following line if you don't want to handle HttpChunks. pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_CONTENT_SIZE)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", requestHandler); return pipeline; }
@Override public ChannelPipeline getPipeline() { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(4096)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", new HttpRequestHandler()); return pipeline; } });
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline cp = Channels.pipeline(); cp.addLast("httpClientCodec", new HttpClientCodec()); cp.addLast("chunkAggregator", new HttpChunkAggregator(maxFrameSize)); if (clientConfig.sslClientConfiguration() != null) { cp.addFirst("ssl", clientConfig.sslClientConfiguration().createHandler(address)); } return cp; } };
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("requestEncoder", new HttpRequestEncoder()); pipeline.addLast("channelEncoder", new HttpEncoder(host, uri)); pipeline.addLast("responseDecoder", new HttpResponseDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); pipeline.addLast("thriftHandler", (ChannelHandler)handler); return pipeline; } }
public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(engineConfig.getMaxFrameSize())); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", webSocketServerHandler); if (engineConfig.getTimeout() > 0) { pipeline.addLast("idleHandler", idleStateHandler); } return pipeline; } }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = new DefaultChannelPipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(1024 * 1024)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("compressor", new HttpContentCompressor()); pipeline.addLast("executionHandler", executionHandler); pipeline.addLast("handler", new Handler()); return pipeline; } }