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 void
close()
protected void
commit(MetaData.Response info)
protected void
consumeInput()
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.HttpTransportOverHTTP2
getHttpTransport()
long
getIdleTimeout()
Get the idle timeout.protected IStream
getStream()
boolean
isExpecting100Continue()
boolean
isRequestIdle()
java.lang.Runnable
onFailure(java.lang.Throwable failure, Callback callback)
void
onFlushed(long bytes)
Invoked when aWriteFlusher
flushed bytes in a non-blocking way, as part of a - possibly larger - write.java.lang.Runnable
onPushRequest(MetaData.Request request)
java.lang.Runnable
onRequest(HeadersFrame frame)
java.lang.Runnable
onRequestContent(DataFrame frame, Callback callback)
java.lang.Runnable
onRequestTrailers(HeadersFrame frame)
boolean
onStreamTimeout(java.lang.Throwable failure, java.util.function.Consumer<java.lang.Runnable> consumer)
void
recycle()
void
setIdleTimeout(long timeoutMs)
Set the idle timeout.java.lang.String
toString()
-
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:
isExpecting100Continue
in classHttpChannel
-
setIdleTimeout
public void setIdleTimeout(long timeoutMs)
Description copied from class:HttpChannel
Set 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:
setIdleTimeout
in classHttpChannel
- Parameters:
timeoutMs
- the idle timeout in milliseconds
-
getIdleTimeout
public long getIdleTimeout()
Description copied from class:HttpChannel
Get 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:
getIdleTimeout
in classHttpChannel
- Returns:
- the idle timeout (in milliseconds)
-
onFlushed
public void onFlushed(long bytes) throws java.io.IOException
Description copied from interface:WriteFlusher.Listener
Invoked when a
WriteFlusher
flushed 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
IOException
to signal that the write should fail, for example if the implementation enforces a minimum data rate.- Specified by:
onFlushed
in 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:
getHttpTransport
in classHttpChannel
-
recycle
public void recycle()
- Overrides:
recycle
in classHttpChannel
-
commit
protected void commit(MetaData.Response info)
- Overrides:
commit
in 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.IOException
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:
continue100
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classHttpChannel
-
-