Package org.elasticsearch.transport
Class LeakTracker
java.lang.Object
org.elasticsearch.transport.LeakTracker
public final class LeakTracker
extends java.lang.Object
Leak tracking mechanism that allows for ensuring that a resource has been properly released before a given object is garbage collected.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LeakTracker.Leak<T>
-
Field Summary
Fields Modifier and Type Field Description static LeakTracker
INSTANCE
-
Method Summary
Modifier and Type Method Description void
reportLeak()
<T> LeakTracker.Leak<T>
track(T obj)
Track the given object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
INSTANCE
-
-
Method Details
-
track
Track the given object.- Parameters:
obj
- object to track- Returns:
- leak object that must be released by a call to
LeakTracker.Leak.close(Object)
beforeobj
goes out of scope
-
reportLeak
public void reportLeak()
-