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) |
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 SendfileState |
processSendfile(org.apache.coyote.http2.SendfileData sendfile)
Process send file (if supported) for the given stream.
|
protected void |
processWrites() |
void |
receivedEndOfStream(int streamId) |
void |
reprioritise(int streamId,
int parentStreamId,
boolean exclusive,
int weight) |
void |
reset(int streamId,
long errorCode) |
protected void |
setConnectionTimeoutForStreamCount(int streamCount) |
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) |
void |
timeoutAsync(long now) |
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()
protected void writeSettings()
protected void writeGoAwayFrame(int maxStreamId, long errorCode, byte[] debugMsg) throws java.io.IOException
java.io.IOException
protected Http2UpgradeHandler.HeaderFrameBuffers getHeaderFrameBuffers(int initialPayloadSize)
public void settingsEnd(boolean ack) throws java.io.IOException
java.io.IOException
protected void processWrites() throws java.io.IOException
java.io.IOException
protected SendfileState processSendfile(org.apache.coyote.http2.SendfileData sendfile)
sendfile
- The stream and associated data to processpublic void init(WebConnection webConnection)
javax.servlet.http.HttpUpgradeHandler
HttpServletRequest.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 HttpUpgradeHandler
webConnection
- The connection that has been upgradedpublic void setSocketWrapper(SocketWrapperBase<?> wrapper)
setSocketWrapper
in interface InternalHttpUpgradeHandler
public void setSslSupport(SSLSupport sslSupport)
setSslSupport
in interface InternalHttpUpgradeHandler
public AbstractEndpoint.Handler.SocketState upgradeDispatch(SocketEvent status)
upgradeDispatch
in interface InternalHttpUpgradeHandler
protected void setConnectionTimeoutForStreamCount(int streamCount)
public void timeoutAsync(long now)
timeoutAsync
in interface InternalHttpUpgradeHandler
public void pause()
pause
in interface InternalHttpUpgradeHandler
public void destroy()
javax.servlet.http.HttpUpgradeHandler
destroy
in interface HttpUpgradeHandler
protected Http2UpgradeHandler.HeaderFrameBuffers doWriteHeaders(org.apache.coyote.http2.Stream stream, int pushedStreamId, MimeHeaders mimeHeaders, boolean endOfStream, int payloadSize) throws java.io.IOException
java.io.IOException
protected org.apache.coyote.http2.HpackEncoder getHpackEncoder()
protected void handleAppInitiatedIOException(java.io.IOException ioe) throws java.io.IOException
java.io.IOException
protected 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
false
java.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.Http2Exception
public void endRequestBodyFrame(int streamId) throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exception
public void receivedEndOfStream(int streamId) throws org.apache.coyote.http2.ConnectionException
org.apache.coyote.http2.ConnectionException
public void swallowedPadding(int streamId, int paddingLength) throws org.apache.coyote.http2.ConnectionException, java.io.IOException
org.apache.coyote.http2.ConnectionException
java.io.IOException
public org.apache.coyote.http2.HpackDecoder.HeaderEmitter headersStart(int streamId, boolean headersEndStream) throws org.apache.coyote.http2.Http2Exception, java.io.IOException
org.apache.coyote.http2.Http2Exception
java.io.IOException
public void reprioritise(int streamId, int parentStreamId, boolean exclusive, int weight) throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exception
public void headersEnd(int streamId) throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exception
public void reset(int streamId, long errorCode) throws org.apache.coyote.http2.Http2Exception
org.apache.coyote.http2.Http2Exception
public void setting(org.apache.coyote.http2.Setting setting, long value) throws org.apache.coyote.http2.ConnectionException
org.apache.coyote.http2.ConnectionException
public void pingReceive(byte[] payload, boolean ack) throws java.io.IOException
java.io.IOException
public 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.Http2Exception
public void swallowed(int streamId, org.apache.coyote.http2.FrameType frameType, int flags, int size) throws java.io.IOException
java.io.IOException
public boolean fill(boolean block, byte[] data) throws java.io.IOException
java.io.IOException
public boolean fill(boolean block, java.nio.ByteBuffer data, int len) throws java.io.IOException
java.io.IOException
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.