T
- entity representation.public abstract class AbstractCharAsyncEntityConsumer<T> extends AbstractCharDataConsumer implements AsyncEntityConsumer<T>
DEF_BUF_SIZE
Modifier | Constructor and Description |
---|---|
|
AbstractCharAsyncEntityConsumer() |
protected |
AbstractCharAsyncEntityConsumer(int bufSize,
CharCodingConfig charCodingConfig) |
Modifier and Type | Method and Description |
---|---|
protected void |
completed()
Triggered to signal completion of data processing.
|
void |
failed(Exception cause)
Triggered to signal a failure in data processing.
|
protected abstract T |
generateContent()
Triggered to generate entity representation.
|
T |
getContent()
Returns the result of entity processing when it becomes available or
null
if the entity is still being received. |
protected abstract void |
streamStart(ContentType contentType)
Triggered to signal beginning of entity content stream.
|
void |
streamStart(EntityDetails entityDetails,
FutureCallback<T> resultCallback)
Signals beginning of an incoming request entity stream.
|
capacityIncrement, consume, data, setCharset, streamEnd, updateCapacity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
consume, streamEnd, updateCapacity
releaseResources
protected AbstractCharAsyncEntityConsumer(int bufSize, CharCodingConfig charCodingConfig)
public AbstractCharAsyncEntityConsumer()
protected abstract void streamStart(ContentType contentType) throws HttpException, IOException
contentType
- the entity content typeHttpException
- in case of an HTTP protocol violation.IOException
- in case of an I/O error.protected abstract T generateContent() throws IOException
IOException
- in case of an I/O error.public final void streamStart(EntityDetails entityDetails, FutureCallback<T> resultCallback) throws IOException, HttpException
AsyncEntityConsumer
streamStart
in interface AsyncEntityConsumer<T>
entityDetails
- the details of the incoming message entity.resultCallback
- the result callback.IOException
- in case of an I/O error.HttpException
- in case of an HTTP protocol violation.protected final void completed() throws IOException
AbstractCharDataConsumer
completed
in class AbstractCharDataConsumer
IOException
- in case of an I/O error.public final void failed(Exception cause)
AsyncEntityConsumer
failed
in interface AsyncEntityConsumer<T>
cause
- the cause of the failure.public final T getContent()
AsyncEntityConsumer
null
if the entity is still being received.getContent
in interface AsyncEntityConsumer<T>
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.