org.apache.http.nio.NHttpConnection |
Known Indirect Subclasses
|
Class Overview
Abstract non-blocking HTTP connection interface. Each connection contains an
HTTP execution context, which can be used to maintain a processing state,
as well as the actual HttpRequest and HttpResponse that are
being transmitted over this connection. Both the request and
the response objects can be null
if there is no incoming or
outgoing message currently being transferred.
Please note non-blocking HTTP connections are stateful and not thread safe.
Input / output operations on non-blocking HTTP connections should be
restricted to the dispatch events triggered by the I/O event dispatch thread.
However, the IOControl
interface is fully threading safe and can be
manipulated from any thread.
Summary
Public Methods |
abstract
HttpContext
|
getContext()
Returns an HTTP execution context associated with this connection.
|
abstract
HttpRequest
|
getHttpRequest()
Returns the current HTTP request if one is being received / transmitted.
|
abstract
HttpResponse
|
getHttpResponse()
Returns the current HTTP response if one is being received / transmitted.
|
abstract
int
|
getStatus()
Returns status of the connection:
ACTIVE : connection is active.
|
[Expand]
Inherited Methods |
From interface
org.apache.http.HttpConnection
abstract
void
|
close()
|
abstract
HttpConnectionMetrics
|
getMetrics()
|
abstract
int
|
getSocketTimeout()
|
abstract
boolean
|
isOpen()
|
abstract
boolean
|
isStale()
|
abstract
void
|
setSocketTimeout(int arg0)
|
abstract
void
|
shutdown()
|
|
From interface
org.apache.http.nio.IOControl
abstract
void
|
requestInput()
Requests event notifications to be triggered when the underlying
channel is ready for input operations.
|
abstract
void
|
requestOutput()
Requests event notifications to be triggered when the underlying
channel is ready for output operations.
|
abstract
void
|
shutdown()
Shuts down the underlying channel.
|
abstract
void
|
suspendInput()
Suspends event notifications about the underlying channel being
ready for input operations.
|
abstract
void
|
suspendOutput()
Suspends event notifications about the underlying channel being
ready for output operations.
|
|
Constants
public
static
final
int
ACTIVE
Constant Value:
0
(0x00000000)
public
static
final
int
CLOSED
Constant Value:
2
(0x00000002)
public
static
final
int
CLOSING
Constant Value:
1
(0x00000001)
Public Methods
public
abstract
HttpContext
getContext
()
Returns an HTTP execution context associated with this connection.
public
abstract
HttpRequest
getHttpRequest
()
Returns the current HTTP request if one is being received / transmitted.
Otherwise returns null
.
Returns
- HTTP request, if available,
null
otherwise.
public
abstract
HttpResponse
getHttpResponse
()
Returns the current HTTP response if one is being received / transmitted.
Otherwise returns null.
Returns
- HTTP response, if available,
null
otherwise.
public
abstract
int
getStatus
()
Returns status of the connection:
ACTIVE
: connection is active.
CLOSING
: connection is being closed.
CLOSED
: connection has been closed.