Package io.netty.util

Class ResourceLeakDetectorFactory


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

      • ResourceLeakDetectorFactory

        public ResourceLeakDetectorFactory()
    • Method Detail

      • 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

        @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