- java.lang.Object
-
- io.netty5.util.ResourceLeakDetectorFactory
-
public abstract class ResourceLeakDetectorFactory extends Object
This static factory should be used to loadResourceLeakDetectors as needed
-
-
Constructor Summary
Constructors Constructor Description ResourceLeakDetectorFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ResourceLeakDetectorFactoryinstance()Get the singleton instance of this factory class.<T> ResourceLeakDetector<T>newResourceLeakDetector(Class<T> resource)Returns a new instance of aResourceLeakDetectorwith the given resource class.abstract <T> ResourceLeakDetector<T>newResourceLeakDetector(Class<T> resource, int samplingInterval)Returns a new instance of aResourceLeakDetectorwith the given resource class.static voidsetResourceLeakDetectorFactory(ResourceLeakDetectorFactory factory)Set the factory's singleton instance.
-
-
-
Method Detail
-
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 theResourceLeakDetectoris called by all the callers of this factory. That is, before initializing a Netty Bootstrap.- Parameters:
factory- the instance that will become the currentResourceLeakDetectorFactory's singleton
-
newResourceLeakDetector
public final <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource)
Returns a new instance of aResourceLeakDetectorwith the given resource class.- Type Parameters:
T- the type of the resource class- Parameters:
resource- the resource class used to initialize theResourceLeakDetector- Returns:
- a new instance of
ResourceLeakDetector
-
newResourceLeakDetector
public abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval)
Returns a new instance of aResourceLeakDetectorwith the given resource class.- Type Parameters:
T- the type of the resource class- Parameters:
resource- the resource class used to initialize theResourceLeakDetectorsamplingInterval- the interval on which sampling takes place- Returns:
- a new instance of
ResourceLeakDetector
-
-