Class Http2ConnectionPropertyKeys
java.lang.Object
io.netty.handler.codec.http2.Http2ConnectionPropertyKeys
Utility methods for creating
Http2Connection.PropertyKeys.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classImplementation ofHttp2Connection.PropertyKeythat specifies the index position of the property and, unlikeDefaultHttp2Connection.DefaultPropertyKey, is not tied to a specificHttp2Connection. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intSafe-guard against misuse: global keys are expected to be created rarely, typically once per use-case and stored in astaticfield, so there should never be a legitimate need for more than this many.private static final AtomicInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static intkeyCount()The number of keys created vianewGlobalKey()so far, which also doubles as the exclusive upper bound forHttp2ConnectionPropertyKeys.GlobalPropertyKey.index.(package private) static Http2Connection.PropertyKeyCreates a new key that, unlike one returned byHttp2Connection.newKey(), is not tied to a specificHttp2Connectioninstance.
-
Field Details
-
MAX_GLOBAL_KEYS
private static final int MAX_GLOBAL_KEYSSafe-guard against misuse: global keys are expected to be created rarely, typically once per use-case and stored in astaticfield, so there should never be a legitimate need for more than this many.- See Also:
-
nextIndex
-
-
Constructor Details
-
Http2ConnectionPropertyKeys
private Http2ConnectionPropertyKeys()
-
-
Method Details
-
newGlobalKey
Creates a new key that, unlike one returned byHttp2Connection.newKey(), is not tied to a specificHttp2Connectioninstance. The returned key can be used with the streams of anyHttp2Connection, which makes it suitable for cases where a key needs to be shared, e.g. stored in astaticfield, across multiple connections, or created before aHttp2Connectioninstance is even available.Accessing a property that is associated with a key returned by this method is slower than accessing one associated with a key returned by
Http2Connection.newKey(). Prefer the latter whenever a specificHttp2Connectioninstance is available up-front. -
keyCount
static int keyCount()The number of keys created vianewGlobalKey()so far, which also doubles as the exclusive upper bound forHttp2ConnectionPropertyKeys.GlobalPropertyKey.index.
-