public class Http2AsyncUpgradeHandler extends 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 AtomicInteger |
activeRemoteStreamCount |
protected 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 |
---|---|
protected byte[] |
createWindowUpdateForSettings() |
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,
ByteBuffer data,
int len) |
protected 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(String connectionId) |
protected org.apache.coyote.http2.Http2UpgradeHandler.PingManager |
getPingManager() |
protected int |
getWeight() |
void |
goaway(int lastStreamId,
long errorCode,
String debugData) |
protected void |
handleAppInitiatedIOException(IOException ioe) |
boolean |
hasAsyncIO() |
void |
headersContinue(int payloadSize,
boolean endOfHeaders) |
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) |
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) |
ByteBuffer |
startRequestBodyFrame(int streamId,
int payloadSize,
boolean endOfStream) |
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()
Write the initial settings frame and any necessary supporting frames.
|
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 String connectionId
protected final Http2Protocol protocol
protected volatile SocketWrapperBase<?> socketWrapper
protected final org.apache.coyote.http2.ConnectionSettingsLocal localSettings
protected final AtomicInteger activeRemoteStreamCount
public Http2AsyncUpgradeHandler(Http2Protocol protocol, Adapter adapter, Request coyoteRequest)
protected org.apache.coyote.http2.Http2Parser getParser(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 IOException
IOException
protected Http2UpgradeHandler.HeaderFrameBuffers getHeaderFrameBuffers(int initialPayloadSize)
public void settingsEnd(boolean ack) throws IOException
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 upgradedprotected void processStreamOnContainerThread(org.apache.coyote.http2.Stream stream)
public 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 byte[] createWindowUpdateForSettings()
protected Http2UpgradeHandler.HeaderFrameBuffers doWriteHeaders(org.apache.coyote.http2.Stream stream, int pushedStreamId, MimeHeaders mimeHeaders, boolean endOfStream, int payloadSize) throws IOException
IOException
protected org.apache.coyote.http2.HpackEncoder getHpackEncoder()
protected void handleAppInitiatedIOException(IOException ioe) throws IOException
IOException
protected void processWrites() throws IOException
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 String getConnectionId()
protected final int getWeight()
public boolean fill(boolean block, byte[] data, int offset, int length) throws 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
IOException
- If an I/O occurred while obtaining data with
which to fill the bufferpublic int getMaxFrameSize()
public HpackDecoder getHpackDecoder()
public ByteBuffer startRequestBodyFrame(int streamId, int payloadSize, boolean endOfStream) 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, IOException
org.apache.coyote.http2.ConnectionException
IOException
public org.apache.coyote.http2.HpackDecoder.HeaderEmitter headersStart(int streamId, boolean headersEndStream) throws org.apache.coyote.http2.Http2Exception, IOException
org.apache.coyote.http2.Http2Exception
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 headersContinue(int payloadSize, boolean endOfHeaders)
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 IOException
IOException
public void goaway(int lastStreamId, long errorCode, 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 IOException
IOException
public boolean fill(boolean block, byte[] data) throws IOException
IOException
public boolean fill(boolean block, ByteBuffer data, int len) throws IOException
IOException
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.