Package io.netty.handler.codec.http2
Class Http2ConnectionPropertyKeys
- java.lang.Object
-
- io.netty.handler.codec.http2.Http2ConnectionPropertyKeys
-
final class Http2ConnectionPropertyKeys extends java.lang.ObjectUtility methods for creatingHttp2Connection.PropertyKeys.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classHttp2ConnectionPropertyKeys.GlobalPropertyKeyImplementation ofHttp2Connection.PropertyKeythat specifies the index position of the property and, unlikeDefaultHttp2Connection.DefaultPropertyKey, is not tied to a specificHttp2Connection.
-
Field Summary
Fields Modifier and Type Field Description private static intMAX_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.private static java.util.concurrent.atomic.AtomicIntegernextIndex
-
Constructor Summary
Constructors Modifier Constructor Description privateHttp2ConnectionPropertyKeys()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (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.PropertyKeynewGlobalKey()Creates a new key that, unlike one returned byHttp2Connection.newKey(), is not tied to a specificHttp2Connectioninstance.
-
-
-
Field Detail
-
MAX_GLOBAL_KEYS
private static final int MAX_GLOBAL_KEYS
Safe-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:
- Constant Field Values
-
nextIndex
private static final java.util.concurrent.atomic.AtomicInteger nextIndex
-
-
Method Detail
-
newGlobalKey
static Http2Connection.PropertyKey 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.
-
-