Package org.eclipse.jetty.server
Class HttpChannelOverHttp
java.lang.Object
org.eclipse.jetty.server.HttpChannel
org.eclipse.jetty.server.HttpChannelOverHttp
- All Implemented Interfaces:
Runnable,HttpParser.ComplianceHandler,HttpParser.HttpHandler,HttpParser.RequestHandler,HttpOutput.Interceptor
public class HttpChannelOverHttp
extends HttpChannel
implements HttpParser.RequestHandler, HttpParser.ComplianceHandler
An HttpChannel customized to be transported over the HTTP/1 protocol
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.server.HttpChannel
HttpChannel.Listener, HttpChannel.TransientListeners -
Field Summary
Fields inherited from class org.eclipse.jetty.server.HttpChannel
NOOP_LISTENER -
Constructor Summary
ConstructorsConstructorDescriptionHttpChannelOverHttp(HttpConnection httpConnection, Connector connector, HttpConfiguration config, EndPoint endPoint, HttpTransport transport) -
Method Summary
Modifier and TypeMethodDescriptionvoidIf a write or similar operation to this channel fails, then this method should be called.voidbadMessage(BadMessageException failure) booleancontent(ByteBuffer content) booleanvoidcontinue100(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.voidearlyEOF()intprotected voidSends an error 500, performing a special logic to detect whether the request is suspended, to avoid concurrent writes from the application.booleanbooleanbooleanbooleanprotected HttpInputnewHttpInput(HttpChannelState state) voidvoidvoidonBlockWaitForContentFailure(Throwable failure) voidonComplianceViolation(HttpCompliance compliance, HttpComplianceSection violation, String reason) voidparsedHeader(HttpField field) voidparsedTrailer(HttpField field) voidrecycle()booleanstartRequest(String method, String requestTarget, HttpVersion version) Methods inherited from class org.eclipse.jetty.server.HttpChannel
addListener, addRequestLog, commit, ensureConsumeAllOrNotPersistent, execute, formatAddrOrHost, getByteBufferPool, getBytesWritten, getCommittedMetaData, getConnection, getConnector, getEndPoint, getHttpConfiguration, getHttpTransport, getIdleTimeout, getLocalAddress, getLocalName, getLocalPort, getNextInterceptor, getRemoteAddress, getRequest, getRequestLog, getRequests, getResponse, getScheduler, getServer, getServerAuthority, getState, getTransientListeners, handle, isCommitted, isOptimizedForDirectBuffers, isPersistent, isRequestCompleted, isResponseCompleted, isSendError, newHttpOutput, onBadMessage, onCompleted, onContent, onContentComplete, onEarlyEOF, onRequest, onRequestComplete, onTrailers, removeListener, resetBuffer, run, sendResponse, sendResponse, sendResponseAndComplete, setIdleTimeout, setRequestLog, toString, unwrap, useDirectBuffers, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.http.HttpParser.ComplianceHandler
onComplianceViolationMethods inherited from interface org.eclipse.jetty.http.HttpParser.HttpHandler
badMessage
-
Constructor Details
-
HttpChannelOverHttp
public HttpChannelOverHttp(HttpConnection httpConnection, Connector connector, HttpConfiguration config, EndPoint endPoint, HttpTransport transport)
-
-
Method Details
-
newHttpInput
- Overrides:
newHttpInputin classHttpChannel
-
recycle
public void recycle()- Overrides:
recyclein classHttpChannel
-
isExpecting100Continue
public boolean isExpecting100Continue()- Overrides:
isExpecting100Continuein classHttpChannel
-
isExpecting102Processing
public boolean isExpecting102Processing()- Overrides:
isExpecting102Processingin classHttpChannel
-
startRequest
- Specified by:
startRequestin interfaceHttpParser.RequestHandler
-
parsedHeader
- Specified by:
parsedHeaderin interfaceHttpParser.HttpHandler
-
parsedTrailer
- Specified by:
parsedTrailerin interfaceHttpParser.HttpHandler
-
continue100
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.- Overrides:
continue100in classHttpChannel- Parameters:
available- estimate of the number of bytes that are available- Throws:
IOException- if the InputStream cannot be created
-
earlyEOF
public void earlyEOF()- Specified by:
earlyEOFin interfaceHttpParser.HttpHandler
-
content
- Specified by:
contentin interfaceHttpParser.HttpHandler
-
onAsyncWaitForContent
public void onAsyncWaitForContent()- Overrides:
onAsyncWaitForContentin classHttpChannel
-
onBlockWaitForContent
public void onBlockWaitForContent()- Overrides:
onBlockWaitForContentin classHttpChannel
-
onBlockWaitForContentFailure
- Overrides:
onBlockWaitForContentFailurein classHttpChannel
-
badMessage
- Specified by:
badMessagein interfaceHttpParser.HttpHandler
-
headerComplete
public boolean headerComplete()- Specified by:
headerCompletein interfaceHttpParser.HttpHandler
-
handleException
Description copied from class: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
ErrorHandlermechanisms and the response OutputStream.- Overrides:
handleExceptionin classHttpChannel- Parameters:
x- the Throwable that caused the problem
-
abort
Description copied from class:HttpChannelIf a write or similar operation to this channel fails, then this method should be called.The standard implementation calls
HttpTransport.abort(Throwable).- Overrides:
abortin classHttpChannel- Parameters:
failure- the failure that caused the abort.
-
contentComplete
public boolean contentComplete()- Specified by:
contentCompletein interfaceHttpParser.HttpHandler
-
messageComplete
public boolean messageComplete()- Specified by:
messageCompletein interfaceHttpParser.HttpHandler
-
getHeaderCacheSize
public int getHeaderCacheSize()- Specified by:
getHeaderCacheSizein interfaceHttpParser.HttpHandler
-
onComplianceViolation
public void onComplianceViolation(HttpCompliance compliance, HttpComplianceSection violation, String reason) - Specified by:
onComplianceViolationin interfaceHttpParser.ComplianceHandler
-