本文整理汇总了Java中org.jboss.netty.handler.stream.ChunkedWriteHandler类的典型用法代码示例。如果您正苦于以下问题:Java ChunkedWriteHandler类的具体用法?Java ChunkedWriteHandler怎么用?Java ChunkedWriteHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChunkedWriteHandler类属于org.jboss.netty.handler.stream包,在下文中一共展示了ChunkedWriteHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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
}
示例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
}
示例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;
}
示例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
}
示例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;
}
示例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 ;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}