public class HttpConnection extends AbstractConnection implements Connection
Connection.Listener
EXECUTE_ONFILLABLE
Constructor and Description |
---|
HttpConnection(HttpClient client,
EndPoint endPoint,
HttpDestination destination) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort(Throwable cause) |
protected void |
associate(HttpExchange exchange) |
void |
close()
Performs a logical close of this connection.
|
void |
complete(HttpExchange exchange,
boolean success) |
protected HttpExchange |
disassociate() |
HttpDestination |
getDestination() |
HttpExchange |
getExchange() |
HttpClient |
getHttpClient() |
protected void |
idleTimeout() |
protected boolean |
isClosed() |
void |
onClose()
Callback method invoked when this
Connection is closed. |
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(HttpExchange exchange) |
void |
send(Request request,
Response.CompleteListener listener)
Sends a request with an associated response listener.
|
String |
toString() |
addListener, block, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getMessagesIn, getMessagesOut, 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
public void onClose()
Connection
Callback method invoked when this Connection
is closed.
Creators of the connection implementation are responsible for calling this method.
onClose
in interface Connection
onClose
in class AbstractConnection
protected boolean isClosed()
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.CompleteListener 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 void send(HttpExchange exchange)
public HttpExchange getExchange()
protected void associate(HttpExchange exchange)
protected HttpExchange disassociate()
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 boolean abort(Throwable cause)
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 Closeable
close
in interface AutoCloseable
close
in interface Connection
close
in class AbstractConnection
public String toString()
toString
in class AbstractConnection
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.