H - Type of headpublic abstract class AbstractStream<H> extends Object implements IReadWriteStream<H>
ServiceRequest; the body is a
stream of IApimanBuffer chunks; end() is used indicate that
transmission of the body has completed.
The head handler is also used to indicate the result of the operation.| Modifier and Type | Field and Description |
|---|---|
protected IAsyncHandler<IApimanBuffer> |
bodyHandler |
protected IAsyncHandler<Void> |
endHandler |
protected boolean |
finished |
protected IAsyncHandler<H> |
headHandler |
| Constructor and Description |
|---|
AbstractStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
bodyHandler(IAsyncHandler<IApimanBuffer> bodyHandler)
Handler called when a body chunk has arrived.
|
void |
end()
Signal transmission has ended.
|
void |
endHandler(IAsyncHandler<Void> endHandler)
Handler signals when transmission has completed; no further calls to
IReadStream.bodyHandler(IAsyncHandler) should occur after this has been
invoked. |
protected void |
handleBody(IApimanBuffer chunk)
Called to handle a body chunk.
|
protected void |
handleEnd()
Signals the end of the stream.
|
protected abstract void |
handleHead(H head)
Called to handle the head.
|
void |
headHandler(IAsyncHandler<H> headHandler)
Sets the head handler.
|
boolean |
isFinished()
Indicates whether the stream has finished.
|
void |
write(IApimanBuffer chunk)
Write a chunk to the stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHeadprotected IAsyncHandler<H> headHandler
protected IAsyncHandler<IApimanBuffer> bodyHandler
protected IAsyncHandler<Void> endHandler
protected boolean finished
public void headHandler(IAsyncHandler<H> headHandler)
headHandler - public void bodyHandler(IAsyncHandler<IApimanBuffer> bodyHandler)
IReadStreambodyHandler in interface IReadStream<H>IReadStream.bodyHandler(io.apiman.gateway.engine.async.IAsyncHandler)public void endHandler(IAsyncHandler<Void> endHandler)
IReadStreamIReadStream.bodyHandler(IAsyncHandler) should occur after this has been
invoked.endHandler in interface IReadStream<H>IReadStream.endHandler(io.apiman.gateway.engine.async.IAsyncHandler)public void write(IApimanBuffer chunk)
IWriteStreamIWriteStream.end() has been signalled.write in interface IWriteStreamIWriteStream.write(io.apiman.gateway.engine.io.IApimanBuffer)public void end()
IWriteStreamIWriteStream.write(IApimanBuffer) should be made.end in interface IWriteStreamIWriteStream.end()public boolean isFinished()
IStreamisFinished in interface IStreamIStream.isFinished()protected abstract void handleHead(H head)
head - protected void handleBody(IApimanBuffer chunk)
chunk - protected void handleEnd()
Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.