- java.lang.Object
-
- io.netty5.util.ResourceLeakDetectorFactory
-
public abstract class ResourceLeakDetectorFactory extends Object
This static factory should be used to loadResourceLeakDetector
s 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 ResourceLeakDetectorFactory
instance()
Get the singleton instance of this factory class.<T> ResourceLeakDetector<T>
newResourceLeakDetector(Class<T> resource)
Returns a new instance of aResourceLeakDetector
with the given resource class.abstract <T> ResourceLeakDetector<T>
newResourceLeakDetector(Class<T> resource, int samplingInterval)
Returns a new instance of aResourceLeakDetector
with the given resource class.static void
setResourceLeakDetectorFactory(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 theResourceLeakDetector
is 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 aResourceLeakDetector
with 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 aResourceLeakDetector
with the given resource class.- Type Parameters:
T
- the type of the resource class- Parameters:
resource
- the resource class used to initialize theResourceLeakDetector
samplingInterval
- the interval on which sampling takes place- Returns:
- a new instance of
ResourceLeakDetector
-
-