Class HttpChannelOverHTTP2
- java.lang.Object
-
- org.eclipse.jetty.server.HttpChannel
-
- org.eclipse.jetty.http2.server.HttpChannelOverHTTP2
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Runnable,WriteFlusher.Listener,HttpOutput.Interceptor
- Direct Known Subclasses:
HTTP2ServerConnection.ServerHttpChannelOverHTTP2
public class HttpChannelOverHTTP2 extends HttpChannel implements java.io.Closeable, WriteFlusher.Listener
-
-
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
Constructors Constructor Description HttpChannelOverHTTP2(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransportOverHTTP2 transport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidcommit(MetaData.Response info)protected voidconsumeInput()voidcontinue100(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.HttpTransportOverHTTP2getHttpTransport()longgetIdleTimeout()Get the idle timeout.protected IStreamgetStream()booleanisExpecting100Continue()booleanisRequestIdle()java.lang.RunnableonFailure(java.lang.Throwable failure, Callback callback)voidonFlushed(long bytes)Invoked when aWriteFlusherflushed bytes in a non-blocking way, as part of a - possibly larger - write.java.lang.RunnableonPushRequest(MetaData.Request request)java.lang.RunnableonRequest(HeadersFrame frame)java.lang.RunnableonRequestContent(DataFrame frame, Callback callback)java.lang.RunnableonRequestTrailers(HeadersFrame frame)booleanonStreamTimeout(java.lang.Throwable failure, java.util.function.Consumer<java.lang.Runnable> consumer)voidrecycle()voidsetIdleTimeout(long timeoutMs)Set the idle timeout.java.lang.StringtoString()-
Methods inherited from class org.eclipse.jetty.server.HttpChannel
abort, addListener, addRequestLog, ensureConsumeAllOrNotPersistent, execute, formatAddrOrHost, getByteBufferPool, getBytesWritten, getCommittedMetaData, getConnection, getConnector, getEndPoint, getHttpConfiguration, getLocalAddress, getLocalName, getLocalPort, getNextInterceptor, getRemoteAddress, getRequest, getRequestLog, getRequests, getResponse, getScheduler, getServer, getServerAuthority, getState, getTransientListeners, handle, handleException, isCommitted, isExpecting102Processing, isOptimizedForDirectBuffers, isPersistent, isRequestCompleted, isResponseCompleted, isSendError, newHttpInput, newHttpOutput, onAsyncWaitForContent, onBadMessage, onBlockWaitForContent, onBlockWaitForContentFailure, onCompleted, onContent, onContentComplete, onEarlyEOF, onRequest, onRequestComplete, onTrailers, removeListener, resetBuffer, run, sendResponse, sendResponse, sendResponseAndComplete, setRequestLog, unwrap, useDirectBuffers, write
-
-
-
-
Constructor Detail
-
HttpChannelOverHTTP2
public HttpChannelOverHTTP2(Connector connector, HttpConfiguration configuration, EndPoint endPoint, HttpTransportOverHTTP2 transport)
-
-
Method Detail
-
getStream
protected IStream getStream()
-
isExpecting100Continue
public boolean isExpecting100Continue()
- Overrides:
isExpecting100Continuein classHttpChannel
-
setIdleTimeout
public void setIdleTimeout(long timeoutMs)
Description copied from class:HttpChannelSet the idle timeout.This is implemented as a call to
EndPoint.setIdleTimeout(long), but may be overridden by channels that have timeouts different from their connections.- Overrides:
setIdleTimeoutin classHttpChannel- Parameters:
timeoutMs- the idle timeout in milliseconds
-
getIdleTimeout
public long getIdleTimeout()
Description copied from class:HttpChannelGet the idle timeout.This is implemented as a call to
EndPoint.getIdleTimeout(), but may be overridden by channels that have timeouts different from their connections.- Overrides:
getIdleTimeoutin classHttpChannel- Returns:
- the idle timeout (in milliseconds)
-
onFlushed
public void onFlushed(long bytes) throws java.io.IOExceptionDescription copied from interface:WriteFlusher.ListenerInvoked when a
WriteFlusherflushed bytes in a non-blocking way, as part of a - possibly larger - write.This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.
This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.
Implementations may throw an
IOExceptionto signal that the write should fail, for example if the implementation enforces a minimum data rate.- Specified by:
onFlushedin interfaceWriteFlusher.Listener- Parameters:
bytes- the number of bytes flushed- Throws:
java.io.IOException- if the write should fail
-
onRequest
public java.lang.Runnable onRequest(HeadersFrame frame)
-
onPushRequest
public java.lang.Runnable onPushRequest(MetaData.Request request)
-
getHttpTransport
public HttpTransportOverHTTP2 getHttpTransport()
- Overrides:
getHttpTransportin classHttpChannel
-
recycle
public void recycle()
- Overrides:
recyclein classHttpChannel
-
commit
protected void commit(MetaData.Response info)
- Overrides:
commitin classHttpChannel
-
onRequestTrailers
public java.lang.Runnable onRequestTrailers(HeadersFrame frame)
-
isRequestIdle
public boolean isRequestIdle()
-
onStreamTimeout
public boolean onStreamTimeout(java.lang.Throwable failure, java.util.function.Consumer<java.lang.Runnable> consumer)
-
onFailure
public java.lang.Runnable onFailure(java.lang.Throwable failure, Callback callback)
-
consumeInput
protected void consumeInput()
-
continue100
public void continue100(int available) throws java.io.IOExceptionIf 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:
java.io.IOException- if the InputStream cannot be created
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classHttpChannel
-
-