org.restlet.engine.connector
Class ServerInboundWay

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

public abstract class ServerInboundWay
extends InboundWay

Server-side inbound way.

Author:
Jerome Louvel

Constructor Summary
ServerInboundWay(Connection<?> connection, int bufferSize)
          Constructor.
 
Method Summary
protected abstract  Response createResponse(Request request)
          Creates a response object for the given request.
 Message getActualMessage()
          Returns the actual message, request or response.
 Connection<Server> getConnection()
          Returns the parent connection.
 ServerConnectionHelper getHelper()
          Returns the parent connector helper.
protected  boolean hasIoInterest()
          Indicates if we want to be selected for IO processing when the socket related socket is prepared.
protected  void onHeadersCompleted()
          Callback invoked when a message has been received.
protected  void onReceived(Response message)
          Call back invoked when the message is received.
protected  void readStartLine()
          Read the start line of the current message received.
 void updateState()
          Updates the way IO and message states.
 
Methods inherited from class org.restlet.engine.connector.InboundWay
clear, createEntity, fillLine, getBuilderIndex, getEntityRegistration, getInterestOperations, isLineReadable, onDrain, onError, onFill, onFillEof, onMessageCompleted, onPostProcessing, onTimeOut, processIoBuffer, readHeader, setBuilderIndex, setEntityRegistration
 
Methods inherited from class org.restlet.engine.connector.Way
canLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getIoState, getLineBuilder, getLineBuilderState, getLoadScore, getLogger, getMessage, getMessageState, getRegistration, isAvailable, isEmpty, 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

ServerInboundWay

public ServerInboundWay(Connection<?> connection,
                        int bufferSize)
Constructor.

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

createResponse

protected abstract Response createResponse(Request request)
Creates a response object for the given request.

Parameters:
request - The parent request.
Returns:
The new response object.

getActualMessage

public Message getActualMessage()
Description copied from class: Way
Returns the actual message, request or response.

Specified by:
getActualMessage in class Way
Returns:
The actual message, request or response.

getConnection

public Connection<Server> getConnection()
Description copied from class: Way
Returns the parent connection.

Overrides:
getConnection in class Way
Returns:
The parent connection.

getHelper

public ServerConnectionHelper getHelper()
Description copied from class: Way
Returns the parent connector helper.

Overrides:
getHelper in class Way
Returns:
The parent connector helper.

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 Way
Returns:
True if we want to be selected for IO processing when the socket is ready.

onHeadersCompleted

protected void onHeadersCompleted()
                           throws IOException
Description copied from class: InboundWay
Callback invoked when a message has been received. Note that only the start line and the headers must have been received, not the optional body.

Overrides:
onHeadersCompleted in class InboundWay
Throws:
IOException

onReceived

protected void onReceived(Response message)
                   throws IOException
Call back invoked when the message is received.

Specified by:
onReceived in class InboundWay
Parameters:
message - The new message received.
Throws:
IOException

readStartLine

protected void readStartLine()
                      throws IOException
Description copied from class: InboundWay
Read the start line of the current message received.

Specified by:
readStartLine in class InboundWay
Throws:
IOException

updateState

public void updateState()
Description copied from class: Way
Updates the way IO and message states.

Overrides:
updateState in class InboundWay


Copyright © 2005-2013 Restlet.