public class ChunkedResponseWriteHandler extends Object implements org.jboss.netty.channel.ChannelUpstreamHandler, org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.LifeCycleAwareChannelHandler
ChannelHandler that adds support for writing chunked xrootd replies.
Loosely based on org.jboss.netty.handler.stream.ChunkedWriteHandler, but specialized for xrootd.
Xrootd allows replies to be delivered out of order, which means that unchunked responses do not
have to be queued and can be passed downstream right away.
Since the handler is protocol specific, it can generated proper xrootd error responses in case
of faults.
XrootdChunkedWriteHandler does not support suspended transfers.
To use ChunkedResponseWriteHandler, you have to insert
a new ChunkedResponseWriteHandler instance:
Once inserted, you can write aChannelPipelinep = ...; p.addLast("streamer", newChunkedResponseWriteHandler()); p.addLast("handler", new MyHandler());
ChunkedResponse so that the
ChunkedResponseWriteHandler can pick it up and fetch the content of the
stream chunk by chunk and write the fetched chunk downstream:
Channelch = ...;ReadRequestrequest = ...; long maxFrameSize = 2 << 20;FileChannelchannel = ...; ch.write(newChunkedFileChannelReadResponse(request, maxFrameSize, channel));
| Constructor and Description |
|---|
ChunkedResponseWriteHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterAdd(org.jboss.netty.channel.ChannelHandlerContext ctx) |
void |
afterRemove(org.jboss.netty.channel.ChannelHandlerContext ctx) |
void |
beforeAdd(org.jboss.netty.channel.ChannelHandlerContext ctx) |
void |
beforeRemove(org.jboss.netty.channel.ChannelHandlerContext ctx) |
void |
handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelEvent e) |
void |
handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelEvent e) |
public void handleDownstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelEvent e)
throws Exception
handleDownstream in interface org.jboss.netty.channel.ChannelDownstreamHandlerExceptionpublic void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelEvent e)
throws Exception
handleUpstream in interface org.jboss.netty.channel.ChannelUpstreamHandlerExceptionpublic void beforeAdd(org.jboss.netty.channel.ChannelHandlerContext ctx)
throws Exception
beforeAdd in interface org.jboss.netty.channel.LifeCycleAwareChannelHandlerExceptionpublic void afterAdd(org.jboss.netty.channel.ChannelHandlerContext ctx)
throws Exception
afterAdd in interface org.jboss.netty.channel.LifeCycleAwareChannelHandlerExceptionpublic void beforeRemove(org.jboss.netty.channel.ChannelHandlerContext ctx)
throws Exception
beforeRemove in interface org.jboss.netty.channel.LifeCycleAwareChannelHandlerExceptionCopyright © 2013 dCache.org. All rights reserved.