org.restlet.engine.connector
Class ServerOutboundWay

java.lang.Object
  extended by org.restlet.engine.connector.Way
      extended by org.restlet.engine.connector.OutboundWay
          extended by org.restlet.engine.connector.ServerOutboundWay
All Implemented Interfaces:
BufferProcessor, CompletionListener, SelectionListener
Direct Known Subclasses:
HttpServerOutboundWay

public abstract class ServerOutboundWay
extends OutboundWay

Server-side outbound way.

Author:
Jerome Louvel

Constructor Summary
ServerOutboundWay(Connection<Server> connection, int bufferSize)
          Constructor.
 
Method Summary
protected  void addHeaders(Series<Header> headers)
          Add all the headers, including the general, the message specific and the entity headers.
protected  void addResponseHeaders(Series<Header> headers)
          Adds the response headers.
 Response getActualMessage()
          Returns the actual message, request or response.
 Connection<Server> getConnection()
          Returns the parent connection.
 void onMessageCompleted(boolean endDetected)
          Callback method invoked when the current message has been completely received or sent.
protected  void writeStartLine()
          Writes the start line of the current outbound message.
 
Methods inherited from class org.restlet.engine.connector.OutboundWay
addEntityHeaders, addGeneralHeaders, clear, flushBuffer, getEntityChannel, getEntityChannelType, getEntityFileChannel, getEntityInterestOps, getEntitySelectableChannel, getEntitySelectionKey, getHeaderIndex, getInterestOperations, getVersion, handle, hasIoInterest, onDrain, onError, onFill, onFillEof, onHeadersCompleted, onPostProcessing, onTimeOut, processIoBuffer, setEntityChannel, setEntityChannelType, setEntitySelectionKey, setHeaderIndex, shouldBeChunked, updateState, writeLine
 
Methods inherited from class org.restlet.engine.connector.Way
canLoop, clearLineBuilder, couldDrain, couldFill, getBuffer, getHeaders, getHelper, 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

ServerOutboundWay

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

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

addHeaders

protected void addHeaders(Series<Header> headers)
Description copied from class: OutboundWay
Add all the headers, including the general, the message specific and the entity headers.

Specified by:
addHeaders in class OutboundWay
Parameters:
headers - The headers to update.

addResponseHeaders

protected void addResponseHeaders(Series<Header> headers)
Adds the response headers.

Parameters:
headers - The headers series to update.

getActualMessage

public Response 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.

onMessageCompleted

public void onMessageCompleted(boolean endDetected)
                        throws IOException
Description copied from class: Way
Callback method invoked when the current message has been completely received or sent.

Specified by:
onMessageCompleted in interface CompletionListener
Overrides:
onMessageCompleted in class OutboundWay
Parameters:
endDetected - Indicates if the end of the socket channel was detected.
Throws:
IOException

writeStartLine

protected void writeStartLine()
                       throws IOException
Description copied from class: OutboundWay
Writes the start line of the current outbound message.

Specified by:
writeStartLine in class OutboundWay
Throws:
IOException


Copyright © 2005-2013 Restlet.