public class HttpConnection extends AbstractConnection implements Runnable, HttpTransport
A Connection that handles the HTTP protocol.
Connection.Listener| Modifier and Type | Field and Description |
|---|---|
static String |
UPGRADE_CONNECTION_ATTRIBUTE |
EXECUTE_ONFILLABLE| Constructor and Description |
|---|
HttpConnection(HttpConfiguration config,
Connector connector,
EndPoint endPoint) |
| Modifier and Type | Method and Description |
|---|---|
void |
completed() |
Connector |
getConnector() |
static HttpConnection |
getCurrentConnection() |
HttpChannel<?> |
getHttpChannel() |
HttpConfiguration |
getHttpConfiguration() |
int |
getMessagesIn() |
int |
getMessagesOut() |
ByteBuffer |
getRequestBuffer() |
Server |
getServer() |
protected HttpParser |
newHttpParser() |
protected HttpParser.RequestHandler<ByteBuffer> |
newRequestHandler() |
void |
onFillable()
Parses and handles HTTP messages.
|
void |
onOpen() |
void |
reset() |
void |
run() |
void |
send(HttpGenerator.ResponseInfo info,
ByteBuffer content,
boolean lastContent) |
void |
send(HttpGenerator.ResponseInfo info,
ByteBuffer content,
boolean lastContent,
Callback callback) |
protected static void |
setCurrentConnection(HttpConnection connection) |
String |
toString() |
addListener, close, fillInterested, getBytesIn, getBytesOut, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, onClose, onFillInterestedFailed, onReadTimeout, setInputBufferSizepublic static final String UPGRADE_CONNECTION_ATTRIBUTE
public HttpConnection(HttpConfiguration config, Connector connector, EndPoint endPoint)
public static HttpConnection getCurrentConnection()
protected static void setCurrentConnection(HttpConnection connection)
public HttpConfiguration getHttpConfiguration()
protected HttpParser newHttpParser()
protected HttpParser.RequestHandler<ByteBuffer> newRequestHandler()
public Server getServer()
public Connector getConnector()
public HttpChannel<?> getHttpChannel()
public void reset()
public int getMessagesIn()
getMessagesIn in interface ConnectiongetMessagesIn in class AbstractConnectionpublic int getMessagesOut()
getMessagesOut in interface ConnectiongetMessagesOut in class AbstractConnectionpublic String toString()
toString in class AbstractConnectionpublic void onFillable()
Parses and handles HTTP messages.
This method is called when this Connection is ready to read bytes from the EndPoint.
However, it can also be called if there is unconsumed data in the _requestBuffer, as a result of
resuming a suspended request when there is a pipelined request already read into the buffer.
This method fills bytes and parses them until either: EOF is filled; 0 bytes are filled; the HttpChannel finishes handling; or the connection has changed.
onFillable in class AbstractConnectionpublic void onOpen()
onOpen in interface ConnectiononOpen in class AbstractConnectionpublic void send(HttpGenerator.ResponseInfo info, ByteBuffer content, boolean lastContent) throws IOException
send in interface HttpTransportIOExceptionpublic void send(HttpGenerator.ResponseInfo info, ByteBuffer content, boolean lastContent, Callback callback)
send in interface HttpTransportpublic void completed()
completed in interface HttpTransportpublic ByteBuffer getRequestBuffer()
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.