Package io.netty.util
Class LeakPresenceDetector.PresenceTracker<T>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicBoolean
-
- io.netty.util.LeakPresenceDetector.PresenceTracker<T>
-
- All Implemented Interfaces:
ResourceLeakTracker<T>,java.io.Serializable
- Enclosing class:
- LeakPresenceDetector<T>
private static final class LeakPresenceDetector.PresenceTracker<T> extends java.util.concurrent.atomic.AtomicBoolean implements ResourceLeakTracker<T>
-
-
Field Summary
Fields Modifier and Type Field Description private LeakPresenceDetector.ResourceScopescope
-
Constructor Summary
Constructors Constructor Description PresenceTracker(LeakPresenceDetector.ResourceScope scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanclose(java.lang.Object trackedObject)Close the leak so thatResourceLeakTrackerdoes not warn about leaked resources.voidrecord()Records the caller's current stack trace so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly.voidrecord(java.lang.Object hint)Records the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly.-
Methods inherited from class java.util.concurrent.atomic.AtomicBoolean
compareAndSet, get, getAndSet, lazySet, set, toString, weakCompareAndSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.ResourceLeakTracker
getCloseStackTraceIfAny
-
-
-
-
Field Detail
-
scope
private final LeakPresenceDetector.ResourceScope scope
-
-
Constructor Detail
-
PresenceTracker
PresenceTracker(LeakPresenceDetector.ResourceScope scope)
-
-
Method Detail
-
record
public void record()
Description copied from interface:ResourceLeakTrackerRecords the caller's current stack trace so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly. This method is a shortcut torecord(null).- Specified by:
recordin interfaceResourceLeakTracker<T>
-
record
public void record(java.lang.Object hint)
Description copied from interface:ResourceLeakTrackerRecords the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetectorcan tell where the leaked resource was accessed lastly.- Specified by:
recordin interfaceResourceLeakTracker<T>
-
close
public boolean close(java.lang.Object trackedObject)
Description copied from interface:ResourceLeakTrackerClose the leak so thatResourceLeakTrackerdoes not warn about leaked resources. After this method is called a leak associated with this ResourceLeakTracker should not be reported.- Specified by:
closein interfaceResourceLeakTracker<T>- Returns:
trueif called first time,falseif called already
-
-