org.restlet.engine.connector
Class HttpServerInboundWay

java.lang.Object
  extended by org.restlet.engine.connector.Way
      extended by org.restlet.engine.connector.InboundWay
          extended by org.restlet.engine.connector.ServerInboundWay
              extended by org.restlet.engine.connector.HttpServerInboundWay
All Implemented Interfaces:
BufferProcessor, CompletionListener, SelectionListener

public class HttpServerInboundWay
extends ServerInboundWay

HTTP server inbound way.

Author:
Jerome Louvel

Constructor Summary
HttpServerInboundWay(Connection<Server> connection, int bufferSize)
          Constructor.
 
Method Summary
 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.
 
Methods inherited from class org.restlet.engine.connector.ServerInboundWay
getActualMessage, getConnection, getHelper, onHeadersCompleted, readStartLine, updateState
 
Methods inherited from class org.restlet.engine.connector.InboundWay
createEntity, fillLine, getBuilderIndex, getEntityRegistration, getInterestOperations, isLineReadable, onDrain, onFill, onFillEof, onMessageCompleted, onPostProcessing, processIoBuffer, readHeader, setBuilderIndex, setEntityRegistration
 
Methods inherited from class org.restlet.engine.connector.Way
canLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getIoState, getLineBuilder, getLineBuilderState, getLogger, getMessage, getMessageState, getRegistration, onClosed, onSelected, postProcess, preProcess, setHeaders, setIoState, setLineBuilderState, setMessage, setMessageState, setRegistration, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpServerInboundWay

public HttpServerInboundWay(Connection<Server> connection,
                            int bufferSize)
Constructor.

Parameters:
connection - The parent connection.
bufferSize - The byte buffer size.
Method Detail

clear

public void clear()
Description copied from class: Way
Recycles the way so it can be reused. Typically invoked by a connection pool.

Overrides:
clear in class InboundWay

createResponse

protected Response createResponse(Request request)
Description copied from class: ServerInboundWay
Creates a response object for the given request.

Specified by:
createResponse in class ServerInboundWay
Parameters:
request - The parent request.
Returns:
The new response object.

getLoadScore

public int getLoadScore()
Description copied from class: Way
Returns a score representing the way load and that could be compared with other ways of the same parent connection.

Overrides:
getLoadScore in class Way
Returns:
A score representing the way load.

getMessages

public Queue<Response> getMessages()
Returns the queue of messages.

Returns:
The queue of messages.

hasIoInterest

protected boolean hasIoInterest()
Description copied from class: Way
Indicates if we want to be selected for IO processing when the socket related socket is prepared.

Overrides:
hasIoInterest in class ServerInboundWay
Returns:
True if we want to be selected for IO processing when the socket is ready.

isAvailable

public boolean isAvailable()
Description copied from class: Way
Indicates if the way is available to handle new messages.

Overrides:
isAvailable in class Way
Returns:
True if the way is available to handle new messages.

isEmpty

public boolean isEmpty()
Description copied from class: Way
Indicates if the way is empty.

Overrides:
isEmpty in class Way
Returns:
True if the way is empty.

onError

public void onError(Status status)
Description copied from class: Way
Called on error.

Overrides:
onError in class InboundWay
Parameters:
status - The error status.

onReceived

protected void onReceived(Response message)
                   throws IOException
Description copied from class: ServerInboundWay
Call back invoked when the message is received.

Overrides:
onReceived in class ServerInboundWay
Parameters:
message - The new message received.
Throws:
IOException

onTimeOut

public void onTimeOut()
Description copied from class: Way
Called back by the controller when an IO time out has been detected.

Overrides:
onTimeOut in class InboundWay


Copyright © 2005-2013 Restlet.