- 
- All Known Subinterfaces:
- DnsMessage,- DnsQuery,- DnsResponse,- FileRegion
 - All Known Implementing Classes:
- AbstractDnsMessage,- AbstractReferenceCounted,- DatagramDnsQuery,- DatagramDnsResponse,- DefaultDnsQuery,- DefaultDnsResponse,- DefaultFileRegion,- OpenSslContext,- OpenSslEngine,- ReferenceCountedOpenSslClientContext,- ReferenceCountedOpenSslContext,- ReferenceCountedOpenSslEngine,- ReferenceCountedOpenSslServerContext
 
 public interface ReferenceCountedA reference-counted object that requires explicit deallocation.When a new ReferenceCountedis instantiated, it starts with the reference count of1.retain()increases the reference count, andrelease()decreases the reference count. If the reference count is decreased to0, the object will be deallocated explicitly, and accessing the deallocated object will usually result in an access violation.If an object that implements ReferenceCountedis a container of other objects that implementReferenceCounted, the contained objects will also be released viarelease()when the container's reference count becomes 0.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description intrefCnt()Returns the reference count of this object.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.ReferenceCountedretain()Increases the reference count by1.ReferenceCountedretain(int increment)Increases the reference count by the specifiedincrement.ReferenceCountedtouch()Records the current access location of this object for debugging purposes.ReferenceCountedtouch(Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.
 
- 
- 
- 
Method Detail- 
refCntint refCnt() Returns the reference count of this object. If0, it means this object has been deallocated.
 - 
retainReferenceCounted retain() Increases the reference count by1.
 - 
retainReferenceCounted retain(int increment) Increases the reference count by the specifiedincrement.
 - 
touchReferenceCounted touch() Records 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).
 - 
touchReferenceCounted touch(Object hint) Records 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.
 - 
releaseboolean release() Decreases the reference count by1and deallocates this object if the reference count reaches at0.- Returns:
- trueif and only if the reference count became- 0and this object has been deallocated
 
 - 
releaseboolean release(int decrement) Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Returns:
- trueif and only if the reference count became- 0and this object has been deallocated
 
 
- 
 
-