public class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandler, HttpParser.ComplianceHandler
Constructor and Description |
---|
HttpChannelOverHttp(HttpConnection httpConnection,
Connector connector,
HttpConfiguration config,
EndPoint endPoint,
HttpTransport transport) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable failure)
If a write or similar operation to this channel fails,
then this method should be called.
|
void |
asyncReadFillInterested() |
void |
badMessage(int status,
String reason) |
boolean |
content(ByteBuffer content) |
void |
continue100(int available)
If the associated response has the Expect header set to 100 Continue,
then accessing the input stream indicates that the handler/servlet
is ready for the request body and thus a 100 Continue response is sent.
|
void |
earlyEOF() |
int |
getHeaderCacheSize() |
protected void |
handleException(Throwable x)
Sends an error 500, performing a special logic to detect whether the request is suspended,
to avoid concurrent writes from the application.
|
boolean |
headerComplete() |
boolean |
isExpecting100Continue() |
boolean |
isExpecting102Processing() |
boolean |
messageComplete() |
protected HttpInput |
newHttpInput(HttpChannelState state) |
void |
onComplianceViolation(HttpCompliance compliance,
HttpCompliance required,
String reason) |
void |
parsedHeader(HttpField field) |
void |
recycle() |
boolean |
startRequest(String method,
String uri,
HttpVersion version) |
addRequestLog, commit, execute, getByteBufferPool, getBytesWritten, getCommittedMetaData, getConnector, getEndPoint, getHttpConfiguration, getHttpTransport, getIdleTimeout, getLocalAddress, getNextInterceptor, getRemoteAddress, getRequest, getRequestLog, getRequests, getResponse, getScheduler, getServer, getState, handle, isCommitted, isOptimizedForDirectBuffers, newHttpOutput, onBadMessage, onCompleted, onContent, onEarlyEOF, onRequest, onRequestComplete, run, sendResponse, sendResponse, setIdleTimeout, setRequestLog, toString, useDirectBuffers, write
public HttpChannelOverHttp(HttpConnection httpConnection, Connector connector, HttpConfiguration config, EndPoint endPoint, HttpTransport transport)
protected HttpInput newHttpInput(HttpChannelState state)
newHttpInput
in class HttpChannel
public void recycle()
recycle
in class HttpChannel
public boolean isExpecting100Continue()
isExpecting100Continue
in class HttpChannel
public boolean isExpecting102Processing()
isExpecting102Processing
in class HttpChannel
public boolean startRequest(String method, String uri, HttpVersion version)
startRequest
in interface HttpParser.RequestHandler
public void parsedHeader(HttpField field)
parsedHeader
in interface HttpParser.HttpHandler
public void continue100(int available) throws IOException
continue100
in class HttpChannel
available
- estimate of the number of bytes that are availableIOException
- if the InputStream cannot be createdpublic void earlyEOF()
earlyEOF
in interface HttpParser.HttpHandler
public boolean content(ByteBuffer content)
content
in interface HttpParser.HttpHandler
public void asyncReadFillInterested()
asyncReadFillInterested
in class HttpChannel
public void badMessage(int status, String reason)
badMessage
in interface HttpParser.HttpHandler
public boolean headerComplete()
headerComplete
in interface HttpParser.HttpHandler
protected void handleException(Throwable x)
HttpChannel
Sends an error 500, performing a special logic to detect whether the request is suspended, to avoid concurrent writes from the application.
It may happen that the application suspends, and then throws an exception, while an application
spawned thread writes the response content; in such case, we attempt to commit the error directly
bypassing the ErrorHandler
mechanisms and the response OutputStream.
handleException
in class HttpChannel
x
- the Throwable that caused the problempublic void abort(Throwable failure)
HttpChannel
The standard implementation calls HttpTransport.abort(Throwable)
.
abort
in class HttpChannel
failure
- the failure that caused the abort.public boolean messageComplete()
messageComplete
in interface HttpParser.HttpHandler
public int getHeaderCacheSize()
getHeaderCacheSize
in interface HttpParser.HttpHandler
public void onComplianceViolation(HttpCompliance compliance, HttpCompliance required, String reason)
onComplianceViolation
in interface HttpParser.ComplianceHandler
Copyright © 1995-2016 Webtide. All Rights Reserved.