Package io.netty.util
Class ResourceLeakDetectorFactory
java.lang.Object
io.netty.util.ResourceLeakDetectorFactory
- Direct Known Subclasses:
ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory
This static factory should be used to load
ResourceLeakDetector
s as needed-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
Default implementation that loads custom leak detector via system property -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ResourceLeakDetectorFactory
private static final InternalLogger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLeakDetectorFactory
instance()
Get the singleton instance of this factory class.final <T> ResourceLeakDetector
<T> newResourceLeakDetector
(Class<T> resource) Returns a new instance of aResourceLeakDetector
with the given resource class.<T> ResourceLeakDetector
<T> newResourceLeakDetector
(Class<T> resource, int samplingInterval) Returns a new instance of aResourceLeakDetector
with the given resource class.abstract <T> ResourceLeakDetector
<T> newResourceLeakDetector
(Class<T> resource, int samplingInterval, long maxActive) Deprecated.static void
Set the factory's singleton instance.
-
Field Details
-
logger
-
factoryInstance
-
-
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 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
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
@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
ResourceLeakDetector
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 placemaxActive
- This is deprecated and will be ignored.- Returns:
- a new instance of
ResourceLeakDetector
-
newResourceLeakDetector
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
-
newResourceLeakDetector(Class, int)
instead.