com.continuuity.http
Class BodyConsumer

java.lang.Object
  extended by com.continuuity.http.BodyConsumer

public abstract class BodyConsumer
extends Object

HttpHandler would extend this abstract class and implement methods to stream the body directly. chunk method would receive the http-chunks of the body and finished would be called on receipt of the last chunk.


Constructor Summary
BodyConsumer()
           
 
Method Summary
abstract  void chunk(org.jboss.netty.buffer.ChannelBuffer request, HttpResponder responder)
          Http request content will be streamed directly to this method.
abstract  void finished(HttpResponder responder)
          This is called on the receipt of the last HttpChunk.
abstract  void handleError(Throwable cause)
          When there is exception on netty while streaming, it will be propagated to handler so the handler can do the cleanup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyConsumer

public BodyConsumer()
Method Detail

chunk

public abstract void chunk(org.jboss.netty.buffer.ChannelBuffer request,
                           HttpResponder responder)
Http request content will be streamed directly to this method.

Parameters:
request -
responder -

finished

public abstract void finished(HttpResponder responder)
This is called on the receipt of the last HttpChunk.

Parameters:
responder -

handleError

public abstract void handleError(Throwable cause)
When there is exception on netty while streaming, it will be propagated to handler so the handler can do the cleanup.

Parameters:
cause -


Copyright 2013 Continuuity, Inc. Licensed under the Apache License, Version 2.0