Package io.netty.util
Interface ResourceLeakTracker<T>
-
public interface ResourceLeakTracker<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
close(T trackedObject)
Close the leak so thatResourceLeakTracker
does not warn about leaked resources.default @Nullable java.lang.Throwable
getCloseStackTraceIfAny()
Get aThrowable
representing the stack trace of the originalclose(Object)
call.void
record()
Records the caller's current stack trace so that theResourceLeakDetector
can tell where the leaked resource was accessed lastly.void
record(java.lang.Object hint)
Records the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetector
can tell where the leaked resource was accessed lastly.
-
-
-
Method Detail
-
record
void record()
Records the caller's current stack trace so that theResourceLeakDetector
can tell where the leaked resource was accessed lastly. This method is a shortcut torecord(null)
.
-
record
void record(java.lang.Object hint)
Records the caller's current stack trace and the specified additional arbitrary information so that theResourceLeakDetector
can tell where the leaked resource was accessed lastly.
-
close
boolean close(T trackedObject)
Close the leak so thatResourceLeakTracker
does not warn about leaked resources. After this method is called a leak associated with this ResourceLeakTracker should not be reported.- Returns:
true
if called first time,false
if called already
-
getCloseStackTraceIfAny
@Nullable default @Nullable java.lang.Throwable getCloseStackTraceIfAny()
Get aThrowable
representing the stack trace of the originalclose(Object)
call. If this tracker hasn't been cloesd, or close tracking isn't supported or enabled, then this method returnsnull
.- Returns:
- A throwable with the stack trace of the successful close call, or
null
.
-
-