本文整理汇总了Java中org.jboss.netty.handler.stream.ChunkedWriteHandler类的典型用法代码示例。如果您正苦于以下问题:Java ChunkedWriteHandler类的具体用法?Java ChunkedWriteHandler怎么用?Java ChunkedWriteHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChunkedWriteHandler类属于org.jboss.netty.handler.stream包,在下文中一共展示了ChunkedWriteHandler类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的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: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的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
示例3: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
if (sslFactory != null) {
pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine()));
}
int maxChunkSize = getConfig().getInt(ConfVars.SHUFFLE_FETCHER_CHUNK_MAX_SIZE.varname,
ConfVars.SHUFFLE_FETCHER_CHUNK_MAX_SIZE.defaultIntVal);
pipeline.addLast("codec", new HttpServerCodec(maxUrlLength, 8192, maxChunkSize));
pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16));
pipeline.addLast("chunking", new ChunkedWriteHandler());
pipeline.addLast("shuffle", PullServer);
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:apache,项目名称:tajo,代码行数:18,代码来源:TajoPullServerService.java
示例4: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
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());
//pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
//pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("handler", new HttpDataServerHandler(ret));
return pipeline;
}
开发者ID:apache,项目名称:incubator-tajo,代码行数:19,代码来源:HttpDataServerPipelineFactory.java
示例5: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的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", PullServer);
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:apache,项目名称:incubator-tajo,代码行数:17,代码来源:TajoPullServerService.java
示例6: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
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());
//pipeline.addLast("aggregator", new HttpChunkAggregator(65536));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("handler", new HttpDataServerHandler(userName, appId));
return pipeline;
}
开发者ID:apache,项目名称:incubator-tajo,代码行数:19,代码来源:HttpDataServerPipelineFactory.java
示例7: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的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
示例8: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = super.getPipeline();
HttpBlobHandler blobHandler = new HttpBlobHandler(transport.blobService, transport.blobIndices, sslEnabled);
pipeline.addBefore("aggregator", "blob_handler", blobHandler);
if (sslEnabled) {
// required for blob support with ssl enabled (zero copy doesn't work with https)
pipeline.addBefore("blob_handler", "chunkedWriter", new ChunkedWriteHandler());
}
return pipeline;
}
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:CrateNettyHttpServerTransport.java
示例9: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的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
示例10: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
return Channels.pipeline(
new HttpRequestDecoder(),
new HttpChunkAggregator(1 << 16),
new HttpResponseEncoder(),
new ChunkedWriteHandler(),
shuffleHandler);
}
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:10,代码来源:TaskTracker.java
示例11: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = new DefaultChannelPipeline();
if (this.config != null) {
SSLEngine engine = config.getServerSSLEngine();
if (engine != null) {
pipeline.addLast("ssl", new SslHandler(engine)); //$NON-NLS-1$
}
}
pipeline.addLast("decoder", new ObjectDecoder(maxMessageSize, maxLobSize, 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;
}
开发者ID:kenweezy,项目名称:teiid,代码行数:16,代码来源:SSLAwareChannelHandler.java
示例12: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
public ChannelPipeline getPipeline() throws Exception {
Integer max = Integer.valueOf(Play.configuration.getProperty("play.netty.maxContentLength", "-1"));
String mode = Play.configuration.getProperty("play.netty.clientAuth", "none");
ChannelPipeline pipeline = pipeline();
// Add SSL handler first to encrypt and decrypt everything.
SSLEngine engine = SslHttpServerContextFactory.getServerContext().createSSLEngine();
engine.setUseClientMode(false);
if ("want".equalsIgnoreCase(mode)) {
engine.setWantClientAuth(true);
} else if ("need".equalsIgnoreCase(mode)) {
engine.setNeedClientAuth(true);
}
engine.setEnableSessionCreation(true);
pipeline.addLast("flashPolicy", new FlashPolicyHandler());
pipeline.addLast("ssl", new SslHandler(engine));
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new StreamChunkAggregator(max));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
pipeline.addLast("handler", new SslPlayHandler());
return pipeline;
}
开发者ID:eBay,项目名称:restcommander,代码行数:31,代码来源:SslHttpServerPipelineFactory.java
示例13: decode
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
private void decode(ChannelHandlerContext context, ChannelBuffer buffer, SocketAddress remoteAddress) throws Exception {
ChannelPipeline pipeline = context.getPipeline();
if (detectSsl && SslHandler.isEncrypted(buffer)) {
SSLEngine engine = SSL_SERVER_CONTEXT.getValue().createSSLEngine();
engine.setUseClientMode(false);
pipeline.addLast("ssl", new SslHandler(engine));
pipeline.addLast("streamer", new ChunkedWriteHandler());
pipeline.addLast("unificationWOSsl", new PortUnificationServerHandler(delegatingHttpRequestHandler, null, false, detectGzip));
}
else {
int magic1 = buffer.getUnsignedByte(buffer.readerIndex());
int magic2 = buffer.getUnsignedByte(buffer.readerIndex() + 1);
if (detectGzip && magic1 == 31 && magic2 == 139) {
pipeline.addLast("gzipDeflater", new ZlibEncoder(ZlibWrapper.GZIP));
pipeline.addLast("gzipInflater", new ZlibDecoder(ZlibWrapper.GZIP));
pipeline.addLast("unificationWOGzip", new PortUnificationServerHandler(delegatingHttpRequestHandler, null, detectSsl, false));
}
else {
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("aggregator", new HttpChunkAggregator(1048576));
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("deflater", new HttpContentCompressor());
pipeline.addLast("handler", delegatingHttpRequestHandler);
}
}
// must be after new channels handlers addition (netty bug?)
pipeline.remove(this);
Channels.fireMessageReceived(context, buffer, remoteAddress);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:PortUnificationServerHandler.java
示例14: enableSsl
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
private void enableSsl(HTTPInterfaceResource resource, ChannelHandlerContext ctx) throws IOException {
if (!(ctx.getChannel().getLocalAddress() instanceof InetSocketAddress)) {
throw new IllegalStateException(
"Cannot perform SSL over SocketAddress of type "
+ ctx.getChannel().getLocalAddress().getClass()
.getName());
}
ChannelPipeline p = ctx.getPipeline();
p.addLast(
"ssl",
new SslHandler(server
.createSSLEngine(resource,
(InetSocketAddress) ctx.getChannel()
.getLocalAddress(), (InetSocketAddress) ctx
.getChannel().getRemoteAddress())));
p.addLast("decoder", new HttpRequestDecoder());
p.addLast("encoder", new HttpResponseEncoder());
p.addLast("chunkedWriter", new ChunkedWriteHandler());
p.addLast("executionHandler", server.executionHandler);
try {
p.addLast("http", new HttpRequestDispatcherHandler(server));
} catch (ServletException e) {
log.error("Servlet error", e);
ctx.getChannel().close();
}
p.remove(this);
}
开发者ID:ludup,项目名称:hypersocket-framework,代码行数:31,代码来源:SSLSwitchingHandler.java
示例15: enablePlainHttp
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
private void enablePlainHttp(ChannelHandlerContext ctx) {
ChannelPipeline p = ctx.getPipeline();
p.addLast("decoder", new HttpRequestDecoder());
p.addLast("aggregator", new HttpChunkAggregator(Integer.MAX_VALUE));
p.addLast("encoder", new HttpResponseEncoder());
p.addLast("chunkedWriter", new ChunkedWriteHandler());
try {
p.addLast("http", new HttpRequestDispatcherHandler(server));
} catch (ServletException e) {
log.error("Servlet error", e);
ctx.getChannel().close();
}
p.remove(this);
}
开发者ID:ludup,项目名称:hypersocket-framework,代码行数:15,代码来源:SSLSwitchingHandler.java
示例16: setChunkedHttpPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
private void setChunkedHttpPipeline(ServerBootstrap bootstrap, final NettyContainer jerseyHandler) {
bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
pipeline.addLast("encoder", new HttpResponseEncoder());
pipeline.addLast("chunks", new ChunkedWriteHandler());
pipeline.addLast("jerseyHandler", jerseyHandler);
return pipeline;
}
});
bootstrap.setOption("child.tcpNoDelay", true);
bootstrap.setOption("child.keepAlive", true);
}
开发者ID:graylog-labs,项目名称:jersey-netty,代码行数:16,代码来源:NettyContainerTest.java
示例17: getPipeline
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
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:apache,项目名称:tez,代码行数:14,代码来源:ShuffleHandler.java
示例18: createPipelineFactory
import org.jboss.netty.handler.stream.ChunkedWriteHandler; //导入依赖的package包/类
@Override
protected ChannelPipelineFactory createPipelineFactory(final ChannelGroup group) {
return new ChannelPipelineFactory() {
private final ChannelGroupHandler groupHandler = new ChannelGroupHandler(group);
private final HashedWheelTimer timer = new HashedWheelTimer();
private final TimeUnit TIMEOUT_UNIT = TimeUnit.SECONDS;
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast(GROUP_HANDLER, groupHandler);
pipeline.addLast("idleHandler", new IdleStateHandler(timer, 0, 0, timeout, TIMEOUT_UNIT));
pipeline.addLast(TIMEOUT_HANDLER, new ImapIdleStateHandler());
pipeline.addLast(CONNECTION_LIMIT_HANDLER, new ConnectionLimitUpstreamHandler(IMAPServer.this.connectionLimit));
pipeline.addLast(CONNECTION_LIMIT_PER_IP_HANDLER, new ConnectionPerIpLimitUpstreamHandler(IMAPServer.this.connPerIP));
// Add the text line decoder which limit the max line length,
// don't strip the delimiter and use CRLF as delimiter
pipeline.addLast(FRAMER, new DelimiterBasedFrameDecoder(maxLineLength, false, Delimiters.lineDelimiter()));
Encryption secure = getEncryption();
if (secure != null && !secure.isStartTLS()) {
// We need to set clientMode to false.
// See https://issues.apache.org/jira/browse/JAMES-1025
SSLEngine engine = secure.getContext().createSSLEngine();
engine.setUseClientMode(false);
pipeline.addFirst(SSL_HANDLER, new SslHandler(engine));
}
pipeline.addLast(CONNECTION_COUNT_HANDLER, getConnectionCountHandler());
pipeline.addLast(CHUNK_WRITE_HANDLER, new ChunkedWriteHandler());
ExecutionHandler ehandler = getExecutionHandler();
if (ehandler != null) {
pipeline.addLast(EXECUTION_HANDLER, ehandler);
}
pipeline.addLast(REQUEST_DECODER, new ImapRequestFrameDecoder(decoder, inMemorySizeLimit, literalSizeLimit));
pipeline.addLast(CORE_HANDLER, createCoreHandler());
return pipeline;
}
};
}
开发者ID:twachan,项目名称:James,代码行数:48,代码来源:IMAPServer.java
注:本文中的org.jboss.netty.handler.stream.ChunkedWriteHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论