org.apache.http.impl.nio
Class DefaultNHttpServerConnection

java.lang.Object
  extended by org.apache.http.impl.nio.NHttpConnectionBase
      extended by org.apache.http.impl.nio.DefaultNHttpServerConnection
All Implemented Interfaces:
HttpConnection, HttpInetConnection, IOControl, NHttpConnection, NHttpServerConnection, NHttpServerIOTarget, SessionBufferStatus

public class DefaultNHttpServerConnection
extends NHttpConnectionBase
implements NHttpServerIOTarget


Field Summary
protected  NHttpMessageParser requestParser
           
protected  NHttpMessageWriter responseWriter
           
 
Fields inherited from class org.apache.http.impl.nio.NHttpConnectionBase
connMetrics, contentDecoder, contentEncoder, context, hasBufferedInput, hasBufferedOutput, inbuf, incomingContentStrategy, inTransportMetrics, outbuf, outgoingContentStrategy, outTransportMetrics, request, response, session, status
 
Fields inherited from interface org.apache.http.nio.NHttpConnection
ACTIVE, CLOSED, CLOSING
 
Constructor Summary
DefaultNHttpServerConnection(IOSession session, HttpRequestFactory requestFactory, ByteBufferAllocator allocator, HttpParams params)
           
 
Method Summary
 void consumeInput(NHttpServiceHandler handler)
           
protected  NHttpMessageParser createRequestParser(SessionInputBuffer buffer, HttpRequestFactory requestFactory, HttpParams params)
           
protected  NHttpMessageWriter createResponseWriter(SessionOutputBuffer buffer, HttpParams params)
           
 boolean isResponseSubmitted()
          Returns true if an HTTP response has been submitted to the client.
 void produceOutput(NHttpServiceHandler handler)
           
 void resetInput()
          Resets output state.
 void resetOutput()
          Resets input state.
 void submitResponse(HttpResponse response)
          Submits the HTTP response to the client.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.http.impl.nio.NHttpConnectionBase
assertNotClosed, close, getContext, getHttpRequest, getHttpResponse, getLocalAddress, getLocalPort, getMetrics, getRemoteAddress, getRemotePort, getSocketTimeout, getStatus, hasBufferedInput, hasBufferedOutput, isOpen, isStale, prepareDecoder, prepareEncoder, requestInput, requestOutput, setSocketTimeout, shutdown, suspendInput, suspendOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.http.nio.NHttpConnection
getContext, getHttpRequest, getHttpResponse, getStatus
 
Methods inherited from interface org.apache.http.HttpConnection
close, getMetrics, getSocketTimeout, isOpen, isStale, setSocketTimeout, shutdown
 
Methods inherited from interface org.apache.http.nio.IOControl
requestInput, requestOutput, shutdown, suspendInput, suspendOutput
 

Field Detail

requestParser

protected final NHttpMessageParser requestParser

responseWriter

protected final NHttpMessageWriter responseWriter
Constructor Detail

DefaultNHttpServerConnection

public DefaultNHttpServerConnection(IOSession session,
                                    HttpRequestFactory requestFactory,
                                    ByteBufferAllocator allocator,
                                    HttpParams params)
Method Detail

createRequestParser

protected NHttpMessageParser createRequestParser(SessionInputBuffer buffer,
                                                 HttpRequestFactory requestFactory,
                                                 HttpParams params)

createResponseWriter

protected NHttpMessageWriter createResponseWriter(SessionOutputBuffer buffer,
                                                  HttpParams params)

resetInput

public void resetInput()
Description copied from interface: NHttpServerConnection
Resets output state. This method can be used to prematurely terminate processing of the incoming HTTP request.

Specified by:
resetInput in interface NHttpServerConnection

resetOutput

public void resetOutput()
Description copied from interface: NHttpServerConnection
Resets input state. This method can be used to prematurely terminate processing of the outgoing HTTP response.

Specified by:
resetOutput in interface NHttpServerConnection

consumeInput

public void consumeInput(NHttpServiceHandler handler)
Specified by:
consumeInput in interface NHttpServerIOTarget

produceOutput

public void produceOutput(NHttpServiceHandler handler)
Specified by:
produceOutput in interface NHttpServerIOTarget

submitResponse

public void submitResponse(HttpResponse response)
                    throws java.io.IOException,
                           HttpException
Description copied from interface: NHttpServerConnection
Submits the HTTP response to the client.

Specified by:
submitResponse in interface NHttpServerConnection
Parameters:
response - HTTP response
Throws:
java.io.IOException - if I/O error occurs while submitting the response
HttpException - if the HTTP response violates the HTTP protocol.

isResponseSubmitted

public boolean isResponseSubmitted()
Description copied from interface: NHttpServerConnection
Returns true if an HTTP response has been submitted to the client.

Specified by:
isResponseSubmitted in interface NHttpServerConnection
Returns:
true if an HTTP response has been submitted, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.