public class HttpConnection extends AbstractConnection implements Connection
Connection.Listener
Constructor and Description |
---|
HttpConnection(HttpClient client,
EndPoint endPoint,
HttpDestination destination) |
Modifier and Type | Method and Description |
---|---|
void |
abort(HttpResponse response) |
void |
close()
Performs a logical close of this connection.
|
void |
complete(HttpExchange exchange,
boolean success) |
HttpDestination |
getDestination() |
HttpExchange |
getExchange() |
HttpClient |
getHttpClient() |
protected void |
idleTimeout() |
void |
onFillable()
Callback method invoked when the endpoint is ready to be read.
|
void |
onOpen()
Callback method invoked when this
Connection is opened. |
protected boolean |
onReadTimeout()
Callback method invoked when the endpoint failed to be ready to be read after a timeout
|
void |
proceed(boolean proceed) |
protected void |
receive() |
void |
send(Request request,
Response.Listener listener)
Sends a request with an associated response listener.
|
protected void |
setExchange(HttpExchange exchange) |
String |
toString() |
addListener, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, onClose, onFillInterestedFailed, setInputBufferSize
public HttpConnection(HttpClient client, EndPoint endPoint, HttpDestination destination)
public HttpClient getHttpClient()
public HttpDestination getDestination()
public void onOpen()
Connection
Callback method invoked when this Connection
is opened.
Creators of the connection implementation are responsible for calling this method.
onOpen
in interface Connection
onOpen
in class AbstractConnection
protected boolean onReadTimeout()
AbstractConnection
Callback method invoked when the endpoint failed to be ready to be read after a timeout
onReadTimeout
in class AbstractConnection
protected void idleTimeout()
public void send(Request request, Response.Listener listener)
Connection
Request.send(Response.Listener)
will eventually call this method to send the request.
It is exposed to allow applications to send requests via unpooled connections.request
- the request to sendlistener
- the response listenerpublic HttpExchange getExchange()
protected void setExchange(HttpExchange exchange)
public void onFillable()
AbstractConnection
Callback method invoked when the endpoint is ready to be read.
onFillable
in class AbstractConnection
AbstractConnection.fillInterested()
protected void receive()
public void complete(HttpExchange exchange, boolean success)
public void abort(HttpResponse response)
public void proceed(boolean proceed)
public void close()
Connection
Performs a logical close of this connection.
For simple connections, this may just mean to delegate the close to the associated
EndPoint
but, for example, SSL connections should write the SSL close message
before closing the associated EndPoint
.
close
in interface AutoCloseable
close
in interface Connection
close
in class AbstractConnection
public String toString()
toString
in class AbstractConnection
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.