Package io.netty.handler.ssl
Class DefaultOpenSslCredential
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.ssl.DefaultOpenSslCredential
-
- All Implemented Interfaces:
OpenSslCredential,OpenSslCredentialPointer,ReferenceCounted
final class DefaultOpenSslCredential extends AbstractReferenceCounted implements OpenSslCredentialPointer
Default implementation ofOpenSslCredential.This class manages the lifecycle of a native BoringSSL
SSL_CREDENTIALobject.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.handler.ssl.OpenSslCredential
OpenSslCredential.CredentialType
-
-
Field Summary
Fields Modifier and Type Field Description private longcredentialprivate ResourceLeakTracker<DefaultOpenSslCredential>leakprivate static ResourceLeakDetector<DefaultOpenSslCredential>leakDetectorprivate OpenSslCredential.CredentialTypetype
-
Constructor Summary
Constructors Constructor Description DefaultOpenSslCredential(long credential, OpenSslCredential.CredentialType type)Creates a new credential instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcredentialAddress()Returns the nativeSSL_CREDENTIALpointer address.protected voiddeallocate()Called onceAbstractReferenceCounted.refCnt()is equals 0.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement)Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.DefaultOpenSslCredentialretain()Increases the reference count by1.DefaultOpenSslCredentialretain(int increment)Increases the reference count by the specifiedincrement.DefaultOpenSslCredentialtouch()Records the current access location of this object for debugging purposes.DefaultOpenSslCredentialtouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.OpenSslCredential.CredentialTypetype()Returns the type of this credential.-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, setRefCnt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt
-
-
-
-
Field Detail
-
leakDetector
private static final ResourceLeakDetector<DefaultOpenSslCredential> leakDetector
-
leak
private final ResourceLeakTracker<DefaultOpenSslCredential> leak
-
type
private final OpenSslCredential.CredentialType type
-
credential
private long credential
-
-
Constructor Detail
-
DefaultOpenSslCredential
DefaultOpenSslCredential(long credential, OpenSslCredential.CredentialType type)Creates a new credential instance.- Parameters:
credential- the native SSL_CREDENTIAL pointertype- the credential type
-
-
Method Detail
-
credentialAddress
public long credentialAddress()
Description copied from interface:OpenSslCredentialPointerReturns the nativeSSL_CREDENTIALpointer address.- Specified by:
credentialAddressin interfaceOpenSslCredentialPointer- Returns:
- the native pointer address
-
type
public OpenSslCredential.CredentialType type()
Description copied from interface:OpenSslCredentialReturns the type of this credential.- Specified by:
typein interfaceOpenSslCredential- Returns:
- the credential type
-
deallocate
protected void deallocate()
Description copied from class:AbstractReferenceCountedCalled onceAbstractReferenceCounted.refCnt()is equals 0.- Specified by:
deallocatein classAbstractReferenceCounted
-
retain
public DefaultOpenSslCredential retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceOpenSslCredential- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
retain
public DefaultOpenSslCredential retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceOpenSslCredential- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractReferenceCounted
-
touch
public DefaultOpenSslCredential 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
public DefaultOpenSslCredential touch(java.lang.Object hint)
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
-
release
public boolean release()
Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Overrides:
releasein classAbstractReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement)
Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Overrides:
releasein classAbstractReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
-