本文整理汇总了Java中org.jboss.netty.handler.codec.http.HttpChunkAggregator类的典型用法代码示例。如果您正苦于以下问题:Java HttpChunkAggregator类的具体用法?Java HttpChunkAggregator怎么用?Java HttpChunkAggregator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HttpChunkAggregator类属于org.jboss.netty.handler.codec.http包,在下文中一共展示了HttpChunkAggregator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@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);
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
}
示例2: startHttpServer
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
private ServerBootstrap startHttpServer(int port,
final Token<DelegationTokenIdentifier> token, final URI url) {
ServerBootstrap bootstrap = new ServerBootstrap(
new NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()));
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
@Override
public ChannelPipeline getPipeline() throws Exception {
return Channels.pipeline(new HttpRequestDecoder(),
new HttpChunkAggregator(65536), new HttpResponseEncoder(),
new CredentialsLogicHandler(token, url.toString()));
}
});
bootstrap.bind(new InetSocketAddress("localhost", port));
return bootstrap;
}
示例3: getPipelineFactory
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipelineFactory getPipelineFactory() {
executionHandler = new NaviExecutionHandler();
return new ChannelPipelineFactory() {
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("httpCodec", new NaviHttpServerCodec());
pipeline.addLast("inflater", new HttpContentDecompressor());
pipeline.addLast("GLOBAL_TRAFFIC_SHAPING", globalTcHandler);
String chunkSize = ServerConfigure.get(NaviDefine.CHUNK_AGGR_SIZE);
if (StringUtils.isNumeric(chunkSize)) {
pipeline.addLast("aggregator", new HttpChunkAggregator(Integer.valueOf(chunkSize)));
}
// pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("execution", executionHandler);
pipeline.addLast("idleState", new IdleStateHandler(timer, getChildChannelIdleTime(), getChildChannelIdleTime(), getChildChannelIdleTime()));
pipeline.addLast("handler", getNaviHttpHandler());
return pipeline;
}
};
}
示例4: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = Channels.pipeline();
SslHandler sslHandler = configureServerSSLOnDemand();
if (sslHandler != null) {
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));
if (configuration.isChunked()) {
pipeline.addLast("aggregator", new HttpChunkAggregator(configuration.getChunkedMaxContentLength()));
}
pipeline.addLast("encoder", new HttpResponseEncoder());
if (configuration.isCompression()) {
pipeline.addLast("deflater", new HttpContentCompressor());
}
pipeline.addLast("handler", channelFactory.getChannelHandler());
return pipeline;
}
示例5: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@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
}
示例6: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline( ) throws Exception
{
ChannelPipeline pipeline = pipeline( ) ;
//Descomentar se for usar HTTPS
// SSLEngine engine = SecureChatSslContextFactory.getServerContext( ).createSSLEngine( ) ;
// engine.setUseClientMode( false ) ;
// pipeline.addLast( "ssl", new SslHandler( engine ) ) ;
pipeline.addLast( "decoder", new HttpRequestDecoder( ) ) ;
pipeline.addLast( "aggregator", new HttpChunkAggregator( 65536 ) ) ;
pipeline.addLast( "encoder", new HttpResponseEncoder( ) ) ;
pipeline.addLast( "chunkedWriter", new ChunkedWriteHandler( ) ) ;
pipeline.addLast( "handler", new BettaUdpFileServerHandler( ) ) ;
return pipeline ;
}
示例7: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception
{
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("codec", new HttpClientCodec());
pipeline.addLast("dechunker", new HttpChunkAggregator(_maxResponseSize));
pipeline.addLast("rapiCodec", new RAPClientCodec());
// Could introduce an ExecutionHandler here (before RAPResponseHandler)
// to execute the response handling on a different thread.
pipeline.addLast("responseHandler", _responseHandler);
// Add handler to dynamically configure SSL-related handlers depending on
// the SSL configuration and request URI.
if (_sslContext != null)
{
pipeline.addLast("sslRequestHandler", new SslRequestHandler(_sslContext,
_sslParameters));
}
pipeline.addLast("channelManager", _handler);
return pipeline;
}
示例8: run
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
public void run() {
// Configure the server.
ServerBootstrap bootstrap = new ServerBootstrap(new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
// Set up the event pipeline factory.
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
public ChannelPipeline getPipeline() {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("handler", new HttpHandler());
return pipeline;
}
});
bootstrap.setOption("child.reuseAddress", true);
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.keepAlive", false);
// Bind and start to accept incoming connections.
bootstrap.bind(new InetSocketAddress(port));
}
示例9: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() {
ChannelPipeline pipeline = Channels.pipeline();
// decoders
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("chunker", new HttpChunkAggregator(MAX_REQUEST_LENGTH));
// encoders
pipeline.addLast("encoder", new HttpResponseEncoder());
// handler
pipeline.addLast("timeout", new IdleStateHandler(timer, NetworkConstants.IDLE_TIME, 0, 0));
pipeline.addLast("handler", handler);
return pipeline;
}
示例10: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
if ( ssl ) {
SSLEngine sslEngine = WebSocketSslContextFactory.getServerContext().createSSLEngine();
sslEngine.setUseClientMode( false );
pipeline.addLast( "ssl", new SslHandler( sslEngine ) );
}
pipeline.addLast( "decoder", new HttpRequestDecoder() );
pipeline.addLast( "aggregator", new HttpChunkAggregator( 65536 ) );
pipeline.addLast( "encoder", new HttpResponseEncoder() );
pipeline.addLast( "execution", executionHandler );
pipeline.addLast( "handler", new WebSocketChannelHandler( emf, smf, management, securityManager, ssl ) );
return pipeline;
}
示例11: initTrackerServers
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("httpEncoder", new HttpResponseEncoder());
pipeline.addLast("httpDecoder", new HttpRequestDecoder());
pipeline.addLast("httpAggregator", new HttpChunkAggregator(16384));
pipeline.addLast("objectDecoder", new PiligrimProtocolDecoder(PiligrimProtocol.this));
}
});
}
示例12: initTrackerServers
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("httpEncoder", new HttpResponseEncoder());
pipeline.addLast("httpDecoder", new HttpRequestDecoder());
pipeline.addLast("httpAggregator", new HttpChunkAggregator(65535));
pipeline.addLast("objectDecoder", new DmtHttpProtocolDecoder(DmtHttpProtocol.this));
}
});
}
示例13: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("openChannels", transport.serverOpenChannels);
HttpRequestDecoder requestDecoder = new HttpRequestDecoder(
(int) transport.maxInitialLineLength.bytes(),
(int) transport.maxHeaderSize.bytes(),
(int) transport.maxChunkSize.bytes()
);
if (transport.maxCumulationBufferCapacity != null) {
if (transport.maxCumulationBufferCapacity.bytes() > Integer.MAX_VALUE) {
requestDecoder.setMaxCumulationBufferCapacity(Integer.MAX_VALUE);
} else {
requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity.bytes());
}
}
if (transport.maxCompositeBufferComponents != -1) {
requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
}
pipeline.addLast("decoder", requestDecoder);
pipeline.addLast("decoder_compress", new ESHttpContentDecompressor(transport.compression));
HttpChunkAggregator httpChunkAggregator = new HttpChunkAggregator((int) transport.maxContentLength.bytes());
if (transport.maxCompositeBufferComponents != -1) {
httpChunkAggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
}
pipeline.addLast("aggregator", httpChunkAggregator);
pipeline.addLast("encoder", new ESHttpResponseEncoder());
if (transport.compression) {
pipeline.addLast("encoder_compress", new HttpContentCompressor(transport.compressionLevel));
}
if (transport.settings().getAsBoolean(SETTING_CORS_ENABLED, false)) {
pipeline.addLast("cors", new CorsHandler(transport.getCorsConfig()));
}
if (transport.pipelining) {
pipeline.addLast("pipelining", new HttpPipeliningHandler(transport.pipeliningMaxEvents));
}
pipeline.addLast("handler", requestHandler);
return pipeline;
}
示例14: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); // eliminate the need to decode http chunks from the client
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
pipeline.addLast("handler", new RequestHandlerV2(group));
return pipeline;
}
示例15: getPipeline
import org.jboss.netty.handler.codec.http.HttpChunkAggregator; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
// pipeline.addLast("openChannels", transport.serverOpenChannels);
HttpRequestDecoder requestDecoder = new HttpRequestDecoder(transport.maxInitialLineLength, transport.maxHeaderSize,
transport.maxChunkSize);
if (transport.maxCumulationBufferCapacity > 0) {
// if (transport.maxCumulationBufferCapacity > Integer.MAX_VALUE) {
// requestDecoder.setMaxCumulationBufferCapacity(Integer.MAX_VALUE);
// } else {
requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity);
// }
}
if (transport.maxCompositeBufferComponents != -1) {
requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
}
pipeline.addLast("decoder", requestDecoder);
if (transport.compression) {
pipeline.addLast("decoder_compress", new HttpContentDecompressor());
}
HttpChunkAggregator httpChunkAggregator = new HttpChunkAggregator(transport.maxContentLength);
if (transport.maxCompositeBufferComponents != -1) {
httpChunkAggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents);
}
pipeline.addLast("aggregator", httpChunkAggregator);
pipeline.addLast("encoder", new HttpResponseEncoder());
if (transport.compression) {
pipeline.addLast("encoder_compress", new HttpContentCompressor(transport.compressionLevel));
}
pipeline.addLast("handler", requestHandler);
return pipeline;
}