Class ResourceLeakDetectorFactory
java.lang.Object
io.netty.util.ResourceLeakDetectorFactory
This static factory should be used to load
ResourceLeakDetectors as needed-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLeakDetectorFactoryinstance()Get the singleton instance of this factory class.final <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource) Returns a new instance of aResourceLeakDetectorwith the given resource class.<T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval) Returns a new instance of aResourceLeakDetectorwith the given resource class.abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval, long maxActive) Deprecated.UsenewResourceLeakDetector(Class, int)instead.static voidSet the factory's singleton instance.
-
Constructor Details
-
ResourceLeakDetectorFactory
public ResourceLeakDetectorFactory()
-
-
Method Details
-
instance
Get the singleton instance of this factory class.- Returns:
- the current
ResourceLeakDetectorFactory
-
setResourceLeakDetectorFactory
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
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
@Deprecated public abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval, long maxActive) Deprecated.UsenewResourceLeakDetector(Class, int)instead.Returns a new instance of a
ResourceLeakDetectorwith 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 placemaxActive- This is deprecated and will be ignored.- Returns:
- a new instance of
ResourceLeakDetector
-
newResourceLeakDetector
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
-