Class NonOwnedOpenSslCredential
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.netty.handler.ssl.NonOwnedOpenSslCredential
- All Implemented Interfaces:
OpenSslCredential, OpenSslCredentialPointer, ReferenceCounted
final class NonOwnedOpenSslCredential
extends AbstractReferenceCounted
implements OpenSslCredentialPointer
A non-owning wrapper for an
OpenSslCredential pointer.
This class is used when we need to expose an SSL_CREDENTIAL pointer that is managed
by OpenSSL itself (e.g., the credential selected during the handshake). Unlike
DefaultOpenSslCredential, this wrapper does not free the underlying credential
when its reference count reaches zero, as the lifetime is managed externally.
This is a BoringSSL-specific feature.
-
Nested Class Summary
Nested classes/interfaces inherited from interface OpenSslCredential
OpenSslCredential.CredentialType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longprivate booleanprivate final OpenSslCredential.CredentialType -
Constructor Summary
ConstructorsConstructorDescriptionNonOwnedOpenSslCredential(long credential, OpenSslCredential.CredentialType type) Creates a new non-owning credential wrapper. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the nativeSSL_CREDENTIALpointer address.protected voidCalled onceAbstractReferenceCounted.refCnt()is equals 0.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.touch()Records the current access location of this object for debugging purposes.Records the current access location of this object with an additional arbitrary information for debugging purposes.type()Returns the type of this credential.Methods inherited from class AbstractReferenceCounted
refCnt, release, release, setRefCntMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ReferenceCounted
refCnt, release, release
-
Field Details
-
credential
private final long credential -
type
-
released
private volatile boolean released
-
-
Constructor Details
-
NonOwnedOpenSslCredential
NonOwnedOpenSslCredential(long credential, OpenSslCredential.CredentialType type) Creates a new non-owning credential wrapper.- Parameters:
credential- the native SSL_CREDENTIAL pointer (must not be 0)type- the credential type
-
-
Method Details
-
credentialAddress
public long credentialAddress()Description copied from interface:OpenSslCredentialPointerReturns the nativeSSL_CREDENTIALpointer address.- Specified by:
credentialAddressin interfaceOpenSslCredentialPointer- Returns:
- the native pointer address
-
type
Description copied from interface:OpenSslCredentialReturns the type of this credential.- Specified by:
typein interfaceOpenSslCredential- Returns:
- the credential type
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceOpenSslCredential- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceOpenSslCredential- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceOpenSslCredential- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceOpenSslCredential- Specified by:
touchin interfaceReferenceCounted
-
deallocate
protected void deallocate()Description copied from class:AbstractReferenceCountedCalled onceAbstractReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractReferenceCounted
-