Class ResourceLeakDetectorFactory

java.lang.Object
io.netty.util.ResourceLeakDetectorFactory
Direct Known Subclasses:
ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory

public abstract class ResourceLeakDetectorFactory extends java.lang.Object
This static factory should be used to load ResourceLeakDetectors as needed
  • Field Details

  • Constructor Details

    • ResourceLeakDetectorFactory

      public ResourceLeakDetectorFactory()
  • Method Details

    • instance

      public static ResourceLeakDetectorFactory instance()
      Get the singleton instance of this factory class.
      Returns:
      the current ResourceLeakDetectorFactory
    • setResourceLeakDetectorFactory

      public static void setResourceLeakDetectorFactory(ResourceLeakDetectorFactory factory)
      Set the factory's singleton instance. This has to be called before the static initializer of the ResourceLeakDetector is called by all the callers of this factory. That is, before initializing a Netty Bootstrap.
      Parameters:
      factory - the instance that will become the current ResourceLeakDetectorFactory's singleton
    • newResourceLeakDetector

      public final <T> ResourceLeakDetector<T> newResourceLeakDetector(java.lang.Class<T> resource)
      Returns a new instance of a ResourceLeakDetector with the given resource class.
      Type Parameters:
      T - the type of the resource class
      Parameters:
      resource - the resource class used to initialize the ResourceLeakDetector
      Returns:
      a new instance of ResourceLeakDetector
    • newResourceLeakDetector

      @Deprecated public abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(java.lang.Class<T> resource, int samplingInterval, long maxActive)
      Deprecated.
      Use newResourceLeakDetector(Class, int) instead.

      Returns a new instance of a ResourceLeakDetector with the given resource class.

      Type Parameters:
      T - the type of the resource class
      Parameters:
      resource - the resource class used to initialize the ResourceLeakDetector
      samplingInterval - the interval on which sampling takes place
      maxActive - This is deprecated and will be ignored.
      Returns:
      a new instance of ResourceLeakDetector
    • newResourceLeakDetector

      public <T> ResourceLeakDetector<T> newResourceLeakDetector(java.lang.Class<T> resource, int samplingInterval)
      Returns a new instance of a ResourceLeakDetector with the given resource class.
      Type Parameters:
      T - the type of the resource class
      Parameters:
      resource - the resource class used to initialize the ResourceLeakDetector
      samplingInterval - the interval on which sampling takes place
      Returns:
      a new instance of ResourceLeakDetector