public class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandler, HttpParser.ComplianceHandler
HttpChannel.Listener| Constructor and Description |
|---|
HttpChannelOverHttp(HttpConnection httpConnection,
Connector connector,
HttpConfiguration config,
EndPoint endPoint,
HttpTransport transport) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.lang.Throwable failure)
If a write or similar operation to this channel fails,
then this method should be called.
|
void |
badMessage(BadMessageException failure)
Called to signal that a bad HTTP message has been received.
|
boolean |
content(java.nio.ByteBuffer content) |
boolean |
contentComplete() |
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()
Called to signal that an EOF was received unexpectedly
during the parsing of a HTTP message
|
int |
getHeaderCacheSize() |
protected void |
handleException(java.lang.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 |
onAsyncWaitForContent() |
void |
onBlockWaitForContent() |
void |
onBlockWaitForContentFailure(java.lang.Throwable failure) |
void |
onComplianceViolation(HttpCompliance compliance,
HttpComplianceSection violation,
java.lang.String reason) |
void |
parsedHeader(HttpField field)
This is the method called by parser when a HTTP Header name and value is found
|
void |
parsedTrailer(HttpField field)
This is the method called by parser when a HTTP Trailer name and value is found
|
void |
recycle() |
boolean |
startRequest(java.lang.String method,
java.lang.String uri,
HttpVersion version)
This is the method called by parser when the HTTP request line is parsed
|
addListener, addRequestLog, commit, execute, getByteBufferPool, getBytesWritten, getCommittedMetaData, getConnection, getConnector, getEndPoint, getHttpConfiguration, getHttpTransport, getIdleTimeout, getLocalAddress, getNextInterceptor, getRemoteAddress, getRequest, getRequestLog, getRequests, getResponse, getScheduler, getServer, getState, handle, isCommitted, isOptimizedForDirectBuffers, isPersistent, isRequestCompleted, isResponseCompleted, newHttpOutput, onBadMessage, onCompleted, onContent, onContentComplete, onEarlyEOF, onRequest, onRequestComplete, onTrailers, removeListener, resetBuffer, run, sendError, sendResponse, sendResponse, setIdleTimeout, setRequestLog, toString, unwrap, useDirectBuffers, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitonComplianceViolationbadMessagepublic HttpChannelOverHttp(HttpConnection httpConnection, Connector connector, HttpConfiguration config, EndPoint endPoint, HttpTransport transport)
protected HttpInput newHttpInput(HttpChannelState state)
newHttpInput in class HttpChannelpublic void recycle()
recycle in class HttpChannelpublic boolean isExpecting100Continue()
isExpecting100Continue in class HttpChannelpublic boolean isExpecting102Processing()
isExpecting102Processing in class HttpChannelpublic boolean startRequest(java.lang.String method,
java.lang.String uri,
HttpVersion version)
HttpParser.RequestHandlerstartRequest in interface HttpParser.RequestHandlermethod - The methoduri - The raw bytes of the URI. These are copied into a ByteBuffer that will not be changed until this parser is reset and reused.version - the http version in usepublic void parsedHeader(HttpField field)
HttpParser.HttpHandlerparsedHeader in interface HttpParser.HttpHandlerfield - The field parsedpublic void parsedTrailer(HttpField field)
HttpParser.HttpHandlerparsedTrailer in interface HttpParser.HttpHandlerfield - The field parsedpublic void continue100(int available)
throws java.io.IOException
continue100 in class HttpChannelavailable - estimate of the number of bytes that are availablejava.io.IOException - if the InputStream cannot be createdpublic void earlyEOF()
HttpParser.HttpHandlerearlyEOF in interface HttpParser.HttpHandlerpublic boolean content(java.nio.ByteBuffer content)
content in interface HttpParser.HttpHandlerpublic void onAsyncWaitForContent()
onAsyncWaitForContent in class HttpChannelpublic void onBlockWaitForContent()
onBlockWaitForContent in class HttpChannelpublic void onBlockWaitForContentFailure(java.lang.Throwable failure)
onBlockWaitForContentFailure in class HttpChannelpublic void badMessage(BadMessageException failure)
HttpParser.HttpHandlerbadMessage in interface HttpParser.HttpHandlerfailure - the failure with the bad message informationpublic boolean headerComplete()
headerComplete in interface HttpParser.HttpHandlerprotected void handleException(java.lang.Throwable x)
HttpChannelSends 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 HttpChannelx - the Throwable that caused the problempublic void abort(java.lang.Throwable failure)
HttpChannel
The standard implementation calls HttpTransport.abort(Throwable).
abort in class HttpChannelfailure - the failure that caused the abort.public boolean contentComplete()
contentComplete in interface HttpParser.HttpHandlerpublic boolean messageComplete()
messageComplete in interface HttpParser.HttpHandlerpublic int getHeaderCacheSize()
getHeaderCacheSize in interface HttpParser.HttpHandlerpublic void onComplianceViolation(HttpCompliance compliance, HttpComplianceSection violation, java.lang.String reason)
onComplianceViolation in interface HttpParser.ComplianceHandlerCopyright © 1995–2021 Webtide. All rights reserved.