|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.nio.NHttpConnectionBase
public class NHttpConnectionBase
Field Summary | |
---|---|
protected boolean |
closed
|
protected ContentDecoder |
contentDecoder
|
protected ContentEncoder |
contentEncoder
|
protected HttpContext |
context
|
protected boolean |
hasBufferedInput
|
protected boolean |
hasBufferedOutput
|
protected SessionInputBuffer |
inbuf
|
protected ContentLengthStrategy |
incomingContentStrategy
|
protected CharArrayBuffer |
lineBuffer
|
protected HttpConnectionMetricsImpl |
metrics
|
protected SessionOutputBuffer |
outbuf
|
protected ContentLengthStrategy |
outgoingContentStrategy
|
protected HttpRequest |
request
|
protected HttpResponse |
response
|
protected IOSession |
session
|
Constructor Summary | |
---|---|
NHttpConnectionBase(IOSession session,
ByteBufferAllocator allocator,
HttpParams params)
|
Method Summary | |
---|---|
protected void |
assertNotClosed()
|
void |
close()
Closes this connection gracefully. |
HttpContext |
getContext()
Returns an HTTP execution context associated with this connection. |
HttpRequest |
getHttpRequest()
Returns the current HTTP request if one is being received / transmitted. |
HttpResponse |
getHttpResponse()
Returns the current HTTP response if one is being received / transmitted. |
java.net.InetAddress |
getLocalAddress()
|
int |
getLocalPort()
|
HttpConnectionMetrics |
getMetrics()
Returns a collection of connection metrcis |
java.net.InetAddress |
getRemoteAddress()
|
int |
getRemotePort()
|
int |
getSocketTimeout()
Returns the socket timeout value. |
boolean |
hasBufferedInput()
|
boolean |
hasBufferedOutput()
|
boolean |
isOpen()
Checks if this connection is open. |
boolean |
isStale()
Checks whether this connection has gone down. |
protected HttpEntity |
prepareDecoder(HttpMessage message)
|
protected void |
prepareEncoder(HttpMessage message)
|
void |
requestInput()
Requests event notifications to be triggered when the underlying channel is ready for input oprtations. |
void |
requestOutput()
Requests event notifications to be triggered when the underlying channel is ready for output oprtations. |
void |
setSocketTimeout(int timeout)
Sets the socket timeout value. |
void |
shutdown()
Force-closes this connection. |
void |
suspendInput()
Suspends event notifications about the underlying channel being ready for input operations. |
void |
suspendOutput()
Suspends event notifications about the underlying channel being ready for output operations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IOSession session
protected final HttpContext context
protected final ContentLengthStrategy incomingContentStrategy
protected final ContentLengthStrategy outgoingContentStrategy
protected final SessionInputBuffer inbuf
protected final SessionOutputBuffer outbuf
protected final CharArrayBuffer lineBuffer
protected final HttpConnectionMetricsImpl metrics
protected volatile ContentDecoder contentDecoder
protected volatile boolean hasBufferedInput
protected volatile ContentEncoder contentEncoder
protected volatile boolean hasBufferedOutput
protected volatile HttpRequest request
protected volatile HttpResponse response
protected volatile boolean closed
Constructor Detail |
---|
public NHttpConnectionBase(IOSession session, ByteBufferAllocator allocator, HttpParams params)
Method Detail |
---|
public HttpContext getContext()
NHttpConnection
getContext
in interface NHttpConnection
public HttpRequest getHttpRequest()
NHttpConnection
getHttpRequest
in interface NHttpConnection
public HttpResponse getHttpResponse()
NHttpConnection
getHttpResponse
in interface NHttpConnection
public void requestInput()
IOControl
requestInput
in interface IOControl
public void requestOutput()
IOControl
requestOutput
in interface IOControl
public void suspendInput()
IOControl
suspendInput
in interface IOControl
public void suspendOutput()
IOControl
suspendOutput
in interface IOControl
protected HttpEntity prepareDecoder(HttpMessage message) throws HttpException
HttpException
protected void prepareEncoder(HttpMessage message) throws HttpException
HttpException
public boolean hasBufferedInput()
hasBufferedInput
in interface SessionBufferStatus
public boolean hasBufferedOutput()
hasBufferedOutput
in interface SessionBufferStatus
protected void assertNotClosed() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
HttpConnection
shutdown
instead.
close
in interface HttpConnection
java.io.IOException
public boolean isOpen()
HttpConnection
isOpen
in interface HttpConnection
public boolean isStale()
HttpConnection
isStale
in interface HttpConnection
true
if attempts to use this connection are
likely to succeed, or false
if they are likely
to fail and this connection should be closedpublic java.net.InetAddress getLocalAddress()
getLocalAddress
in interface HttpInetConnection
public int getLocalPort()
getLocalPort
in interface HttpInetConnection
public java.net.InetAddress getRemoteAddress()
getRemoteAddress
in interface HttpInetConnection
public int getRemotePort()
getRemotePort
in interface HttpInetConnection
public void setSocketTimeout(int timeout)
HttpConnection
setSocketTimeout
in interface HttpConnection
timeout
- timeout value in millisecondspublic int getSocketTimeout()
HttpConnection
getSocketTimeout
in interface HttpConnection
0
if timeout is disabled or -1
if
timeout is undefined.public void shutdown() throws java.io.IOException
HttpConnection
shutdown
in interface HttpConnection
shutdown
in interface IOControl
java.io.IOException
public HttpConnectionMetrics getMetrics()
HttpConnection
getMetrics
in interface HttpConnection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |