use of org.jboss.netty.handler.codec.http.HttpResponseEncoder in project socket.io-netty by ibdknox.
the class WebSocketServerPipelineFactory method getPipeline.
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;
}
use of org.jboss.netty.handler.codec.http.HttpResponseEncoder in project databus by linkedin.
the class DummyHttpRequestHandler method setupServer.
private void setupServer(DummyHttpRequestHandler requestHandler) {
_serverBootstrap = new ServerBootstrap(new DefaultLocalServerChannelFactory());
ChannelPipeline serverPipeline = pipeline();
serverPipeline.addLast("server logger 1", new LoggingHandler("server logger 1", InternalLogLevel.DEBUG, true));
serverPipeline.addLast("decoder", new HttpRequestDecoder());
serverPipeline.addLast("encoder", new HttpResponseEncoder());
serverPipeline.addLast("server loggger 5", new LoggingHandler("server logger 5", InternalLogLevel.DEBUG, true));
serverPipeline.addLast("handler", requestHandler);
_serverBootstrap.setPipeline(serverPipeline);
_serverAddress = new LocalAddress(1);
_serverChannel = _serverBootstrap.bind(_serverAddress);
}
use of org.jboss.netty.handler.codec.http.HttpResponseEncoder in project camel by apache.
the class HttpServerPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = Channels.pipeline();
SslHandler sslHandler = configureServerSSLOnDemand();
if (sslHandler != null) {
// must close on SSL exception
sslHandler.setCloseOnSSLException(true);
LOG.debug("Server SSL handler configured and added as an interceptor against the ChannelPipeline: {}", sslHandler);
pipeline.addLast("ssl", sslHandler);
}
pipeline.addLast("decoder", new HttpRequestDecoder(4096, configuration.getMaxHeaderSize(), 8192));
List<ChannelHandler> decoders = consumer.getConfiguration().getDecoders();
for (int x = 0; x < decoders.size(); x++) {
ChannelHandler decoder = decoders.get(x);
if (decoder instanceof ChannelHandlerFactory) {
// use the factory to create a new instance of the channel as it may not be shareable
decoder = ((ChannelHandlerFactory) decoder).newChannelHandler();
}
pipeline.addLast("decoder-" + x, decoder);
}
pipeline.addLast("aggregator", new HttpChunkAggregator(configuration.getChunkedMaxContentLength()));
pipeline.addLast("encoder", new HttpResponseEncoder());
List<ChannelHandler> encoders = consumer.getConfiguration().getEncoders();
for (int x = 0; x < encoders.size(); x++) {
ChannelHandler encoder = encoders.get(x);
if (encoder instanceof ChannelHandlerFactory) {
// use the factory to create a new instance of the channel as it may not be shareable
encoder = ((ChannelHandlerFactory) encoder).newChannelHandler();
}
pipeline.addLast("encoder-" + x, encoder);
}
if (supportCompressed()) {
pipeline.addLast("deflater", new HttpContentCompressor());
}
if (consumer.getConfiguration().isOrderedThreadPoolExecutor()) {
// this must be added just before the HttpServerMultiplexChannelHandler
// use ordered thread pool, to ensure we process the events in order, and can send back
// replies in the expected order. eg this is required by TCP.
// and use a Camel thread factory so we have consistent thread namings
ExecutionHandler executionHandler = new ExecutionHandler(consumer.getEndpoint().getComponent().getExecutorService());
pipeline.addLast("executionHandler", executionHandler);
LOG.debug("Using OrderedMemoryAwareThreadPoolExecutor with core pool size: {}", consumer.getConfiguration().getMaximumPoolSize());
}
int port = consumer.getConfiguration().getPort();
ChannelHandler handler = consumer.getEndpoint().getComponent().getMultiplexChannelHandler(port).getChannelHandler();
pipeline.addLast("handler", handler);
return pipeline;
}
use of org.jboss.netty.handler.codec.http.HttpResponseEncoder in project voldemort by voldemort.
the class CoordinatorAdminPipelineFactory method getPipeline.
@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;
}
use of org.jboss.netty.handler.codec.http.HttpResponseEncoder in project voldemort by voldemort.
the class CoordinatorPipelineFactory method getPipeline.
@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;
}
Aggregations