org.restlet.engine.connector
Class ClientOutboundWay

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

public abstract class ClientOutboundWay
extends OutboundWay

Client-side outbound way.

Author:
Jerome Louvel

Constructor Summary
ClientOutboundWay(Connection<?> 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 addRequestHeaders(Series<Header> headers)
          Adds the request headers.
 Request getActualMessage()
          Returns the actual message, request or response.
 Connection<Client> 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

ClientOutboundWay

public ClientOutboundWay(Connection<?> 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.

addRequestHeaders

protected void addRequestHeaders(Series<Header> headers)
Adds the request headers.

Parameters:
headers - The headers series to update.

getActualMessage

public Request 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<Client> 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.