public class Http2AsyncUpgradeHandler
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
Http2AsyncUpgradeHandler.AsyncPingManager |
protected class |
Http2AsyncUpgradeHandler.SendfileCompletionHandler |
protected static interface |
Http2UpgradeHandler.HeaderFrameBuffers |
protected static class |
Http2UpgradeHandler.PingRecord |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicInteger |
activeRemoteStreamCount |
protected java.lang.String |
connectionId |
protected static int |
FLAG_END_OF_HEADERS |
protected static int |
FLAG_END_OF_STREAM |
protected static byte[] |
GOAWAY |
protected org.apache.coyote.http2.ConnectionSettingsLocal |
localSettings
Local settings are settings defined by Tomcat and sent to the client that
the client must use when communicating with Tomcat.
|
protected static Log |
log |
protected static byte[] |
PING |
protected static byte[] |
PING_ACK |
protected Http2Protocol |
protocol |
protected static byte[] |
SETTINGS_ACK |
protected static StringManager |
sm |
protected SocketWrapperBase<?> |
socketWrapper |
| Constructor and Description |
|---|
Http2AsyncUpgradeHandler(Http2Protocol protocol,
Adapter adapter,
Request coyoteRequest) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
This method is called after the upgraded connection has been closed.
|
protected Http2UpgradeHandler.HeaderFrameBuffers |
doWriteHeaders(org.apache.coyote.http2.Stream stream,
int pushedStreamId,
MimeHeaders mimeHeaders,
boolean endOfStream,
int payloadSize) |
void |
endRequestBodyFrame(int streamId) |
default boolean |
fill(boolean block,
byte[] data) |
boolean |
fill(boolean block,
byte[] data,
int offset,
int length)
Fill the given array with data unless non-blocking is requested and
no data is available.
|
default boolean |
fill(boolean block,
java.nio.ByteBuffer data,
int len) |
protected java.lang.String |
getConnectionId() |
protected Http2UpgradeHandler.HeaderFrameBuffers |
getHeaderFrameBuffers(int initialPayloadSize) |
HpackDecoder |
getHpackDecoder() |
protected org.apache.coyote.http2.HpackEncoder |
getHpackEncoder() |
int |
getMaxFrameSize() |
protected org.apache.coyote.http2.Http2Parser |
getParser(java.lang.String connectionId) |
protected org.apache.coyote.http2.Http2UpgradeHandler.PingManager |
getPingManager() |
protected int |
getWeight() |
void |
goaway(int lastStreamId,
long errorCode,
java.lang.String debugData) |
protected void |
handleAppInitiatedIOException(java.io.IOException ioe) |
boolean |
hasAsyncIO() |
void |
headersEnd(int streamId) |
org.apache.coyote.http2.HpackDecoder.HeaderEmitter |
headersStart(int streamId,
boolean headersEndStream) |
protected void |
incrementWindowSize(int increment)
Increment window size.
|
void |
incrementWindowSize(int streamId,
int increment) |
void |
init(WebConnection webConnection)
This method is called once the request/response pair where
HttpServletRequest.upgrade(Class) is called has completed
processing and is the point where control of the connection passes from
the container to the HttpUpgradeHandler. |
void |
pause() |
void |
pingReceive(byte[] payload,
boolean ack) |
protected void |
processConnection(WebConnection webConnection,
org.apache.coyote.http2.Stream stream) |
protected SendfileState |
processSendfile(org.apache.coyote.http2.SendfileData sendfile)
Process send file (if supported) for the given stream.
|
protected void |
processStreamOnContainerThread(org.apache.coyote.http2.Stream stream) |
protected void |
processWrites() |
void |
receivedEndOfStream(int streamId) |
void |
reprioritise(int streamId,
int parentStreamId,
boolean exclusive,
int weight) |
void |
reset(int streamId,
long errorCode) |
void |
setSocketWrapper(SocketWrapperBase<?> wrapper) |
void |
setSslSupport(SSLSupport sslSupport) |
void |
setting(org.apache.coyote.http2.Setting setting,
long value) |
void |
settingsEnd(boolean ack) |
java.nio.ByteBuffer |
startRequestBodyFrame(int streamId,
int payloadSize) |
void |
swallowed(int streamId,
org.apache.coyote.http2.FrameType frameType,
int flags,
int size) |
void |
swallowedPadding(int streamId,
int paddingLength) |
AbstractEndpoint.Handler.SocketState |
upgradeDispatch(SocketEvent status) |
protected void |
writeGoAwayFrame(int maxStreamId,
long errorCode,
byte[] debugMsg) |
protected void |
writeSettings() |
protected static final Log log
protected static final StringManager sm
protected static final int FLAG_END_OF_STREAM
protected static final int FLAG_END_OF_HEADERS
protected static final byte[] PING
protected static final byte[] PING_ACK
protected static final byte[] SETTINGS_ACK
protected static final byte[] GOAWAY
protected final java.lang.String connectionId
protected final Http2Protocol protocol
protected volatile SocketWrapperBase<?> socketWrapper
protected final org.apache.coyote.http2.ConnectionSettingsLocal localSettings
protected final java.util.concurrent.atomic.AtomicInteger activeRemoteStreamCount
public Http2AsyncUpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest)
protected org.apache.coyote.http2.Http2Parser getParser(java.lang.String connectionId)
protected org.apache.coyote.http2.Http2UpgradeHandler.PingManager getPingManager()
public boolean hasAsyncIO()
protected void processConnection(WebConnection webConnection, org.apache.coyote.http2.Stream stream)
protected void writeSettings()
protected void writeGoAwayFrame(int maxStreamId,
long errorCode,
byte[] debugMsg)
throws java.io.IOException
java.io.IOExceptionprotected Http2UpgradeHandler.HeaderFrameBuffers getHeaderFrameBuffers(int initialPayloadSize)
public void settingsEnd(boolean ack)
throws java.io.IOException
java.io.IOExceptionprotected SendfileState processSendfile(org.apache.coyote.http2.SendfileData sendfile)
sendfile - The stream and associated data to processpublic void init(WebConnection webConnection)
javax.servlet.http.HttpUpgradeHandlerHttpServletRequest.upgrade(Class) is called has completed
processing and is the point where control of the connection passes from
the container to the HttpUpgradeHandler.init in interface HttpUpgradeHandlerwebConnection - The connection that has been upgradedprotected void processStreamOnContainerThread(org.apache.coyote.http2.Stream stream)
public void setSocketWrapper(SocketWrapperBase<?> wrapper)
setSocketWrapper in interface InternalHttpUpgradeHandlerpublic void setSslSupport(SSLSupport sslSupport)
setSslSupport in interface InternalHttpUpgradeHandlerpublic AbstractEndpoint.Handler.SocketState upgradeDispatch(SocketEvent status)
upgradeDispatch in interface InternalHttpUpgradeHandlerpublic void pause()
pause in interface InternalHttpUpgradeHandlerpublic void destroy()
javax.servlet.http.HttpUpgradeHandlerdestroy in interface HttpUpgradeHandlerprotected Http2UpgradeHandler.HeaderFrameBuffers doWriteHeaders(org.apache.coyote.http2.Stream stream, int pushedStreamId, MimeHeaders mimeHeaders, boolean endOfStream, int payloadSize) throws java.io.IOException
java.io.IOExceptionprotected org.apache.coyote.http2.HpackEncoder getHpackEncoder()
protected void handleAppInitiatedIOException(java.io.IOException ioe)
throws java.io.IOException
java.io.IOExceptionprotected void processWrites()
throws java.io.IOException
java.io.IOExceptionprotected void incrementWindowSize(int increment)
throws org.apache.coyote.http2.Http2Exception
increment - The amount by which the window size should be increasedHttp2Exception - If the window size is now higher than
the maximum allowedprotected final java.lang.String getConnectionId()
protected final int getWeight()
public boolean fill(boolean block,
byte[] data,
int offset,
int length)
throws java.io.IOException
block - Should the first read into the provided buffer be a
blocking read or not.data - Buffer to filloffset - Position in buffer to start writinglength - Number of bytes to readtrue if the buffer was filled otherwise
falsejava.io.IOException - If an I/O occurred while obtaining data with
which to fill the bufferpublic int getMaxFrameSize()
public HpackDecoder getHpackDecoder()
public java.nio.ByteBuffer startRequestBodyFrame(int streamId,
int payloadSize)
throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exceptionpublic void endRequestBodyFrame(int streamId)
throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exceptionpublic void receivedEndOfStream(int streamId)
throws org.apache.coyote.http2.ConnectionException
org.apache.coyote.http2.ConnectionExceptionpublic void swallowedPadding(int streamId,
int paddingLength)
throws org.apache.coyote.http2.ConnectionException,
java.io.IOException
org.apache.coyote.http2.ConnectionExceptionjava.io.IOExceptionpublic org.apache.coyote.http2.HpackDecoder.HeaderEmitter headersStart(int streamId,
boolean headersEndStream)
throws org.apache.coyote.http2.Http2Exception,
java.io.IOException
org.apache.coyote.http2.Http2Exceptionjava.io.IOExceptionpublic void reprioritise(int streamId,
int parentStreamId,
boolean exclusive,
int weight)
throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exceptionpublic void headersEnd(int streamId)
throws org.apache.coyote.http2.ConnectionException
org.apache.coyote.http2.ConnectionExceptionpublic void reset(int streamId,
long errorCode)
throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exceptionpublic void setting(org.apache.coyote.http2.Setting setting,
long value)
throws org.apache.coyote.http2.ConnectionException
org.apache.coyote.http2.ConnectionExceptionpublic void pingReceive(byte[] payload,
boolean ack)
throws java.io.IOException
java.io.IOExceptionpublic void goaway(int lastStreamId,
long errorCode,
java.lang.String debugData)
public void incrementWindowSize(int streamId,
int increment)
throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exceptionpublic void swallowed(int streamId,
org.apache.coyote.http2.FrameType frameType,
int flags,
int size)
throws java.io.IOException
java.io.IOExceptionpublic boolean fill(boolean block,
byte[] data)
throws java.io.IOException
java.io.IOExceptionpublic boolean fill(boolean block,
java.nio.ByteBuffer data,
int len)
throws java.io.IOException
java.io.IOExceptionCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.