public abstract class ResourceLeakDetectorFactory
extends java.lang.Object
ResourceLeakDetector
s as neededModifier and Type | Class and Description |
---|---|
private static class |
ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory
Default implementation that loads custom leak detector via system property
|
Modifier and Type | Field and Description |
---|---|
private static ResourceLeakDetectorFactory |
factoryInstance |
private static InternalLogger |
logger |
Constructor and Description |
---|
ResourceLeakDetectorFactory() |
Modifier and Type | Method and Description |
---|---|
static ResourceLeakDetectorFactory |
instance()
Get the singleton instance of this factory class.
|
<T> ResourceLeakDetector<T> |
newResourceLeakDetector(java.lang.Class<T> resource)
Returns a new instance of a
ResourceLeakDetector with the given resource class. |
abstract <T> ResourceLeakDetector<T> |
newResourceLeakDetector(java.lang.Class<T> resource,
int samplingInterval,
long maxActive)
Returns a new instance of a
ResourceLeakDetector with the given resource class. |
static void |
setResourceLeakDetectorFactory(ResourceLeakDetectorFactory factory)
Set the factory's singleton instance.
|
private static final InternalLogger logger
private static volatile ResourceLeakDetectorFactory factoryInstance
public static ResourceLeakDetectorFactory instance()
ResourceLeakDetectorFactory
public static void setResourceLeakDetectorFactory(ResourceLeakDetectorFactory factory)
ResourceLeakDetector
is called by all the callers of this factory. That is, before initializing a
Netty Bootstrap.factory
- - the instance that will become the current ResourceLeakDetectorFactory
's singletonpublic final <T> ResourceLeakDetector<T> newResourceLeakDetector(java.lang.Class<T> resource)
ResourceLeakDetector
with the given resource class.T
- - the type of the resource classresource
- - the resource class used to initialize the ResourceLeakDetector
ResourceLeakDetector
public abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(java.lang.Class<T> resource, int samplingInterval, long maxActive)
ResourceLeakDetector
with the given resource class.T
- - the type of the resource classresource
- - the resource class used to initialize the ResourceLeakDetector
samplingInterval
- - the interval on which sampling takes placemaxActive
- - the maximum active instancesResourceLeakDetector