当前位置: 首页>>代码示例>>Java>>正文


Java HttpChunkAggregator类代码示例

本文整理汇总了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
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:ShuffleHandler.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestDelegationTokenRemoteFetcher.java

示例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;
        }
    };
}
 
开发者ID:sunguangran,项目名称:navi,代码行数:27,代码来源:NaviNettyServer.java

示例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;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:HttpServerSharedPipelineFactory.java

示例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
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:19,代码来源:ShuffleHandler.java

示例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 ;
    }
 
开发者ID:wsyssantos,项目名称:BettaServer,代码行数:20,代码来源:BettaUdpFileServerPipelineFactory.java

示例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;
}
 
开发者ID:ppdai,项目名称:rest4j,代码行数:23,代码来源:HttpNettyClient.java

示例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));
}
 
开发者ID:violetgo,项目名称:wifidogAuthServer,代码行数:25,代码来源:HttpServer.java

示例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;
}
 
开发者ID:DealerNextDoor,项目名称:ApolloDev,代码行数:18,代码来源:HttpPipelineFactory.java

示例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;
}
 
开发者ID:apache,项目名称:usergrid,代码行数:17,代码来源:WebSocketServerPipelineFactory.java

示例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));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:PiligrimProtocol.java

示例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));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:DmtHttpProtocol.java

示例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;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:40,代码来源:NettyHttpServerTransport.java

示例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;
}
 
开发者ID:DigitalMediaServer,项目名称:DigitalMediaServer,代码行数:12,代码来源:HttpServerPipelineFactory.java

示例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;
}
 
开发者ID:gncloud,项目名称:fastcatsearch3,代码行数:33,代码来源:HttpTransportModule.java


注:本文中的org.jboss.netty.handler.codec.http.HttpChunkAggregator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。