Class OpenSslCachingKeyMaterialProvider

java.lang.Object
io.netty.handler.ssl.OpenSslKeyMaterialProvider
io.netty.handler.ssl.OpenSslCachingKeyMaterialProvider

final class OpenSslCachingKeyMaterialProvider extends OpenSslKeyMaterialProvider
OpenSslKeyMaterialProvider that will cache the OpenSslKeyMaterial to reduce the overhead of parsing the chain and the key for generation of the material.

Cache reads are lock-free (ConcurrentHashMap.get(Object) + retain()); if a concurrent eviction releases the material in between, retain() detects the dead reference count and the read falls back to a cache miss. Mutations (insert, evict, destroy) use ConcurrentHashMap.compute(K, BiFunction) / ConcurrentHashMap.computeIfPresent(K, BiFunction) for atomicity.