|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.nio.NHttpConnectionBase
org.apache.http.impl.nio.DefaultNHttpClientConnection
public class DefaultNHttpClientConnection
Default implementation of the NHttpClientConnection
interface.
Field Summary | |
---|---|
protected NHttpMessageWriter |
requestWriter
|
protected NHttpMessageParser |
responseParser
|
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 | |
---|---|
DefaultNHttpClientConnection(IOSession session,
HttpResponseFactory responseFactory,
ByteBufferAllocator allocator,
HttpParams params)
Creates a new instance of this class given the underlying I/O session. |
Method Summary | |
---|---|
void |
consumeInput(NHttpClientHandler handler)
Triggered when the connection is ready to consume input. |
protected NHttpMessageWriter |
createRequestWriter(SessionOutputBuffer buffer,
HttpParams params)
Creates an instance of HttpRequestWriter to be used
by this connection for writing out outgoing HttpRequest messages. |
protected NHttpMessageParser |
createResponseParser(SessionInputBuffer buffer,
HttpResponseFactory responseFactory,
HttpParams params)
Creates an instance of HttpResponseParser to be used
by this connection for parsing incoming HttpResponse messages. |
boolean |
isRequestSubmitted()
Returns true if an HTTP request has been submitted to the
target server. |
void |
produceOutput(NHttpClientHandler handler)
Triggered when the connection is ready to produce output. |
void |
resetInput()
Resets output state. |
void |
resetOutput()
Resets input state. |
void |
submitRequest(HttpRequest request)
Submits HttpRequest to be sent to the target server. |
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 |
---|
protected final NHttpMessageParser responseParser
protected final NHttpMessageWriter requestWriter
Constructor Detail |
---|
public DefaultNHttpClientConnection(IOSession session, HttpResponseFactory responseFactory, ByteBufferAllocator allocator, HttpParams params)
The following HTTP parameters affect configuration of this connection:
The CoreConnectionPNames.SOCKET_BUFFER_SIZE
parameter determines the size of the internal socket buffer. If not
defined or set to -1
the default value will be chosen
automatically.
session
- the underlying I/O session.responseFactory
- HTTP response factory.allocator
- byte buffer allocator.params
- HTTP parameters.Method Detail |
---|
protected NHttpMessageParser createResponseParser(SessionInputBuffer buffer, HttpResponseFactory responseFactory, HttpParams params)
HttpResponseParser
to be used
by this connection for parsing incoming HttpResponse
messages.
This method can be overridden in a super class in order to provide
a different implementation of the NHttpMessageParser
interface.
protected NHttpMessageWriter createRequestWriter(SessionOutputBuffer buffer, HttpParams params)
HttpRequestWriter
to be used
by this connection for writing out outgoing HttpRequest
messages.
This method can be overridden by a super class in order to provide
a different implementation of the NHttpMessageWriter
interface.
public void resetInput()
NHttpClientConnection
resetInput
in interface NHttpClientConnection
public void resetOutput()
NHttpClientConnection
resetOutput
in interface NHttpClientConnection
public void consumeInput(NHttpClientHandler handler)
NHttpClientIOTarget
consumeInput
in interface NHttpClientIOTarget
handler
- the client protocol handler.public void produceOutput(NHttpClientHandler handler)
NHttpClientIOTarget
produceOutput
in interface NHttpClientIOTarget
handler
- the client protocol handler.public void submitRequest(HttpRequest request) throws IOException, HttpException
NHttpClientConnection
HttpRequest
to be sent to the target server.
submitRequest
in interface NHttpClientConnection
request
- HTTP request
IOException
- if I/O error occurs while submitting the request
HttpException
- if the HTTP request violates the HTTP protocol.public boolean isRequestSubmitted()
NHttpClientConnection
true
if an HTTP request has been submitted to the
target server.
isRequestSubmitted
in interface NHttpClientConnection
true
if an HTTP request has been submitted,
false
otherwise.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |