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

  • Method Details

    • track

      public <T> LeakTracker.Leak<T> track​(T obj)
      Track the given object.
      Parameters:
      obj - object to track
      Returns:
      leak object that must be released by a call to LeakTracker.Leak.close(Object) before obj goes out of scope
    • reportLeak

      public void reportLeak()