public class HttpServerInboundWay extends ServerInboundWay
Constructor and Description |
---|
HttpServerInboundWay(Connection<Server> connection,
int bufferSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Recycles the way so it can be reused.
|
protected Response |
createResponse(Request request)
Creates a response object for the given request.
|
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.
|
protected boolean |
hasIoInterest()
Indicates if we want to be selected for IO processing when the socket
related socket is prepared.
|
boolean |
isAvailable()
Indicates if the way is available to handle new messages.
|
boolean |
isEmpty()
Indicates if the way is empty.
|
void |
onError(Status status)
Called on error.
|
protected void |
onReceived(Response message)
Call back invoked when the message is received.
|
void |
onTimeOut()
Called back by the controller when an IO time out has been detected.
|
getActualMessage, getConnection, getHelper, onHeadersCompleted, readStartLine, updateState
createEntity, fillLine, getBuilderIndex, getEntityRegistration, getInterestOperations, isLineReadable, onDrain, onFill, onFillEof, onMessageCompleted, onPostProcessing, processIoBuffer, readHeader, setBuilderIndex, setEntityRegistration
canLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getIoState, getLineBuilder, getLineBuilderState, getLogger, getMessage, getMessageState, getRegistration, onClosed, onSelected, postProcess, preProcess, setHeaders, setIoState, setLineBuilderState, setMessage, setMessageState, setRegistration, toString
public HttpServerInboundWay(Connection<Server> connection, int bufferSize)
connection
- The parent connection.bufferSize
- The byte buffer size.public void clear()
Way
clear
in class InboundWay
protected Response createResponse(Request request)
ServerInboundWay
createResponse
in class ServerInboundWay
request
- The parent request.public int getLoadScore()
Way
getLoadScore
in class Way
public Queue<Response> getMessages()
protected boolean hasIoInterest()
Way
hasIoInterest
in class ServerInboundWay
public boolean isAvailable()
Way
isAvailable
in class Way
public boolean isEmpty()
Way
public void onError(Status status)
Way
onError
in class InboundWay
status
- The error status.protected void onReceived(Response message) throws IOException
ServerInboundWay
onReceived
in class ServerInboundWay
message
- The new message received.IOException
public void onTimeOut()
Way
onTimeOut
in class InboundWay
Copyright © 2005–2019. All rights reserved.