public class HttpServerOutboundWay extends ServerOutboundWay
| Constructor and Description |
|---|
HttpServerOutboundWay(Connection<Server> connection,
int bufferSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Recycles the way so it can be reused.
|
int |
getLoadScore()
Returns a score representing the way load and that could be compared with
other ways of the same parent connection.
|
Queue<Response> |
getMessages()
Returns the queue of messages.
|
void |
handle(Response response)
Add a message to the outbound way.
|
boolean |
isEmpty()
Indicates if the way is empty.
|
void |
onError(Status status)
Called on error.
|
void |
onMessageCompleted(boolean endDetected)
Callback method invoked when the current message has been completely
received or sent.
|
void |
onTimeOut()
Called back by the controller when an IO time out has been detected.
|
void |
updateState()
Updates the way IO and message states.
|
addHeaders, addResponseHeaders, getActualMessage, getConnection, writeStartLineaddEntityHeaders, addGeneralHeaders, flushBuffer, getEntityChannel, getEntityChannelType, getEntityFileChannel, getEntityInterestOps, getEntitySelectableChannel, getEntitySelectionKey, getHeaderIndex, getInterestOperations, getVersion, hasIoInterest, onDrain, onFill, onFillEof, onHeadersCompleted, onPostProcessing, processIoBuffer, setEntityChannel, setEntityChannelType, setEntitySelectionKey, setHeaderIndex, shouldBeChunked, writeLinecanLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getHelper, getIoState, getLineBuilder, getLineBuilderState, getLogger, getMessage, getMessageState, getRegistration, isAvailable, onClosed, onSelected, postProcess, preProcess, setHeaders, setIoState, setLineBuilderState, setMessage, setMessageState, setRegistration, toStringpublic HttpServerOutboundWay(Connection<Server> connection, int bufferSize)
connection - The parent connection.bufferSize - The byte buffer size.public void clear()
Wayclear in class OutboundWaypublic int getLoadScore()
WaygetLoadScore in class Waypublic Queue<Response> getMessages()
public void handle(Response response)
OutboundWayhandle in class OutboundWaypublic boolean isEmpty()
Waypublic void onError(Status status)
WayonError in class OutboundWaystatus - The error status.public void onMessageCompleted(boolean endDetected)
throws IOException
WayonMessageCompleted in interface CompletionListeneronMessageCompleted in class ServerOutboundWayendDetected - Indicates if the end of the socket channel was detected.IOExceptionpublic void onTimeOut()
WayonTimeOut in class OutboundWaypublic void updateState()
WayupdateState in class OutboundWayCopyright © 2005–2016. All rights reserved.