java.lang.Runnable, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.io.WriteFlusher.Listener, HttpTransportpublic class HttpConnection extends org.eclipse.jetty.io.AbstractConnection implements java.lang.Runnable, HttpTransport, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.io.WriteFlusher.Listener
A Connection that handles the HTTP protocol.
| Modifier and Type | Field | Description |
|---|---|---|
static org.eclipse.jetty.http.HttpField |
CONNECTION_CLOSE |
|
static java.lang.String |
UPGRADE_CONNECTION_ATTRIBUTE |
| Constructor | Description |
|---|---|
HttpConnection(HttpConfiguration config,
Connector connector,
org.eclipse.jetty.io.EndPoint endPoint,
org.eclipse.jetty.http.HttpCompliance compliance,
boolean recordComplianceViolations) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
abort(java.lang.Throwable failure) |
Aborts this transport.
|
void |
asyncReadFillInterested() |
|
void |
blockingReadFailure(java.lang.Throwable e) |
|
void |
blockingReadFillInterested() |
|
protected boolean |
fillAndParseForContent() |
Fill and parse data looking for content
|
long |
getBytesIn() |
|
long |
getBytesOut() |
|
Connector |
getConnector() |
|
static HttpConnection |
getCurrentConnection() |
Get the current connection that this thread is dispatched to.
|
org.eclipse.jetty.http.HttpGenerator |
getGenerator() |
|
HttpChannel |
getHttpChannel() |
|
HttpConfiguration |
getHttpConfiguration() |
|
long |
getMessagesIn() |
|
long |
getMessagesOut() |
|
org.eclipse.jetty.http.HttpParser |
getParser() |
|
java.nio.ByteBuffer |
getRequestBuffer() |
|
Server |
getServer() |
|
boolean |
isOptimizedForDirectBuffers() |
Is the underlying transport optimized for DirectBuffer usage
|
boolean |
isPushSupported() |
|
boolean |
isRecordHttpComplianceViolations() |
|
boolean |
isRequestBufferEmpty() |
|
protected HttpChannelOverHttp |
newHttpChannel() |
|
protected org.eclipse.jetty.http.HttpGenerator |
newHttpGenerator() |
|
protected org.eclipse.jetty.http.HttpParser |
newHttpParser(org.eclipse.jetty.http.HttpCompliance compliance) |
|
protected org.eclipse.jetty.http.HttpParser.RequestHandler |
newRequestHandler() |
|
void |
onClose() |
|
void |
onCompleted() |
Called to indicated the end of the current request/response cycle (which may be
some time after the last content is sent).
|
void |
onFillable() |
|
protected void |
onFillInterestedFailed(java.lang.Throwable cause) |
|
void |
onFlushed(long bytes) |
|
void |
onOpen() |
|
protected boolean |
onReadTimeout(java.lang.Throwable timeout) |
|
java.nio.ByteBuffer |
onUpgradeFrom() |
|
void |
push(org.eclipse.jetty.http.MetaData.Request request) |
|
void |
run() |
|
void |
send(org.eclipse.jetty.http.MetaData.Response info,
boolean head,
java.nio.ByteBuffer content,
boolean lastContent,
org.eclipse.jetty.util.Callback callback) |
Asynchronous call to send a response (or part) over the transport
|
protected static HttpConnection |
setCurrentConnection(HttpConnection connection) |
|
java.lang.String |
toConnectionString() |
addListener, close, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, isFillInterested, onIdleExpired, removeListener, setInputBufferSize, toString, tryFillInterested, tryFillInterestedpublic static final org.eclipse.jetty.http.HttpField CONNECTION_CLOSE
public static final java.lang.String UPGRADE_CONNECTION_ATTRIBUTE
public HttpConnection(HttpConfiguration config, Connector connector, org.eclipse.jetty.io.EndPoint endPoint, org.eclipse.jetty.http.HttpCompliance compliance, boolean recordComplianceViolations)
public static HttpConnection getCurrentConnection()
for a more general way to access the HttpConnectionprotected static HttpConnection setCurrentConnection(HttpConnection connection)
public HttpConfiguration getHttpConfiguration()
public boolean isRecordHttpComplianceViolations()
protected org.eclipse.jetty.http.HttpGenerator newHttpGenerator()
protected HttpChannelOverHttp newHttpChannel()
protected org.eclipse.jetty.http.HttpParser newHttpParser(org.eclipse.jetty.http.HttpCompliance compliance)
protected org.eclipse.jetty.http.HttpParser.RequestHandler newRequestHandler()
public Server getServer()
public Connector getConnector()
public HttpChannel getHttpChannel()
public org.eclipse.jetty.http.HttpParser getParser()
public org.eclipse.jetty.http.HttpGenerator getGenerator()
public boolean isOptimizedForDirectBuffers()
HttpTransportisOptimizedForDirectBuffers in interface HttpTransportpublic long getMessagesIn()
getMessagesIn in class org.eclipse.jetty.io.AbstractConnectionpublic long getMessagesOut()
getMessagesOut in class org.eclipse.jetty.io.AbstractConnectionpublic java.nio.ByteBuffer onUpgradeFrom()
onUpgradeFrom in interface org.eclipse.jetty.io.Connection.UpgradeFrompublic void onFlushed(long bytes)
throws java.io.IOException
onFlushed in interface org.eclipse.jetty.io.WriteFlusher.Listenerjava.io.IOExceptionpublic java.nio.ByteBuffer getRequestBuffer()
public boolean isRequestBufferEmpty()
public void onFillable()
onFillable in class org.eclipse.jetty.io.AbstractConnectionprotected boolean fillAndParseForContent()
HttpParser.RequestHandler method was called and it returned true;public void onCompleted()
HttpTransportonCompleted in interface HttpTransportprotected boolean onReadTimeout(java.lang.Throwable timeout)
onReadTimeout in class org.eclipse.jetty.io.AbstractConnectionprotected void onFillInterestedFailed(java.lang.Throwable cause)
onFillInterestedFailed in class org.eclipse.jetty.io.AbstractConnectionpublic void onOpen()
onOpen in class org.eclipse.jetty.io.AbstractConnectionpublic void onClose()
onClose in class org.eclipse.jetty.io.AbstractConnectionpublic void run()
run in interface java.lang.Runnablepublic void send(org.eclipse.jetty.http.MetaData.Response info,
boolean head,
java.nio.ByteBuffer content,
boolean lastContent,
org.eclipse.jetty.util.Callback callback)
HttpTransportsend in interface HttpTransportinfo - The header info to send, or null if just sending more data.
The first call to send for a response must have a non null info.head - True if the response if for a HEAD request (and the data should not be sent).content - A buffer of content to be sent.lastContent - True if the content is the last content for the current response.callback - The Callback instance that success or failure of the send is notified onpublic void abort(java.lang.Throwable failure)
HttpTransportThis method should terminate the transport in a way that can indicate an abnormal response to the client, for example by abruptly close the connection.
This method is called when an error response needs to be sent,
but the response is already committed, or when a write failure
is detected. If abort is called, HttpTransport.onCompleted() is not
called
abort in interface HttpTransportfailure - the failure that caused the abort.public boolean isPushSupported()
isPushSupported in interface HttpTransportpublic void push(org.eclipse.jetty.http.MetaData.Request request)
push in interface HttpTransportrequest - A request to use as the basis for generating a pushed response.public void asyncReadFillInterested()
public void blockingReadFillInterested()
public void blockingReadFailure(java.lang.Throwable e)
public long getBytesIn()
getBytesIn in class org.eclipse.jetty.io.AbstractConnectionpublic long getBytesOut()
getBytesOut in class org.eclipse.jetty.io.AbstractConnectionpublic java.lang.String toConnectionString()
toConnectionString in class org.eclipse.jetty.io.AbstractConnectionCopyright © 1995–2018 Webtide. All rights reserved.