Top Description Inners Fields Constructors Methods
io.netty.util

public abstract Class ResourceLeakDetectorFactory

extends Object
Class Inheritance
Known Direct Subclasses
io.netty.util.ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory
Imports
io.netty.util.internal.ObjectUtil, .PlatformDependent, .SystemPropertyUtil, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.lang.reflect.Constructor

This static factory should be used to load ResourceLeakDetectors as needed

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory

Default implementation that loads custom leak detector via system property

Field Summary

Modifier and TypeField and Description
private static volatile ResourceLeakDetectorFactory
private static final InternalLogger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static ResourceLeakDetectorFactory

Returns:

the current ResourceLeakDetectorFactory
instance
()

Get the singleton instance of this factory class.

public final <
the type of the resource class
T
>
ResourceLeakDetector<T>

Returns:

a new instance of ResourceLeakDetector
newResourceLeakDetector
(Class<T>
the resource class used to initialize the ResourceLeakDetector
resource
)

Returns a new instance of a ResourceLeakDetector with the given resource class.

public abstract <
the type of the resource class
T
>
ResourceLeakDetector<T>

Returns:

a new instance of ResourceLeakDetector
newResourceLeakDetector
(Class<T>
the resource class used to initialize the ResourceLeakDetector
resource
,
int
the interval on which sampling takes place
samplingInterval
,
long
This is deprecated and will be ignored.
maxActive
)

Deprecated Use newResourceLeakDetector(Class, int) instead.
public <
the type of the resource class
T
>
ResourceLeakDetector<T>

Returns:

a new instance of ResourceLeakDetector
newResourceLeakDetector
(Class<T>
the resource class used to initialize the ResourceLeakDetector
resource
,
int
the interval on which sampling takes place
samplingInterval
)

Returns a new instance of a ResourceLeakDetector with the given resource class.

public static void
setResourceLeakDetectorFactory(ResourceLeakDetectorFactory
the instance that will become the current ResourceLeakDetectorFactory's singleton
factory
)

Set the factory's singleton instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryInstanceback to summary
private static volatile ResourceLeakDetectorFactory factoryInstance
loggerback to summary
private static final InternalLogger logger

Constructor Detail

ResourceLeakDetectorFactoryback to summary
public ResourceLeakDetectorFactory()

Method Detail

instanceback to summary
public static ResourceLeakDetectorFactory instance()

Get the singleton instance of this factory class.

Returns:ResourceLeakDetectorFactory

the current ResourceLeakDetectorFactory

newResourceLeakDetectorback to summary
public final <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource)

Returns a new instance of a ResourceLeakDetector with the given resource class.

Parameters
<T>
the type of the resource class
resource:Class<T>

the resource class used to initialize the ResourceLeakDetector

Returns:ResourceLeakDetector<T>

a new instance of ResourceLeakDetector

newResourceLeakDetectorback to summary
public abstract <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval, long maxActive)

Deprecated

Use newResourceLeakDetector(Class, int) instead.

Returns a new instance of a ResourceLeakDetector with the given resource class.

Parameters
<T>
the type of the resource class
resource:Class<T>

the resource class used to initialize the ResourceLeakDetector

samplingInterval:int

the interval on which sampling takes place

maxActive:long

This is deprecated and will be ignored.

Returns:ResourceLeakDetector<T>

a new instance of ResourceLeakDetector

Annotations
@Deprecated
newResourceLeakDetectorback to summary
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval)

Returns a new instance of a ResourceLeakDetector with the given resource class.

Parameters
<T>
the type of the resource class
resource:Class<T>

the resource class used to initialize the ResourceLeakDetector

samplingInterval:int

the interval on which sampling takes place

Returns:ResourceLeakDetector<T>

a new instance of ResourceLeakDetector

Annotations
@SuppressWarnings:deprecation
setResourceLeakDetectorFactoryback to summary
public static void setResourceLeakDetectorFactory(ResourceLeakDetectorFactory factory)

Set the factory's singleton instance. This has to be called before the static initializer of the ResourceLeakDetector is called by all the callers of this factory. That is, before initializing a Netty Bootstrap.

Parameters
factory:ResourceLeakDetectorFactory

the instance that will become the current ResourceLeakDetectorFactory's singleton

io.netty.util back to summary

private final Class ResourceLeakDetectorFactory.DefaultResourceLeakDetectorFactory

extends ResourceLeakDetectorFactory
Class Inheritance

Default implementation that loads custom leak detector via system property

Field Summary

Modifier and TypeField and Description
private final Constructor<?>
private final Constructor<?>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Constructor<?>
customClassConstructor(String customLeakDetector)

public <T> ResourceLeakDetector<T>
newResourceLeakDetector(Class<T>
the resource class used to initialize the ResourceLeakDetector
resource
,
int
the interval on which sampling takes place
samplingInterval
,
long
This is deprecated and will be ignored.
maxActive
)

Implements abstract io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

public <T> ResourceLeakDetector<T>
newResourceLeakDetector(Class<T>
the resource class used to initialize the ResourceLeakDetector
resource
,
int
the interval on which sampling takes place
samplingInterval
)

Overrides io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

Returns a new instance of a ResourceLeakDetector with the given resource class.
private static Constructor<?>
Inherited from io.netty.util.ResourceLeakDetectorFactory:
instancenewResourceLeakDetectorsetResourceLeakDetectorFactory

Field Detail

customClassConstructorback to summary
private final Constructor<?> customClassConstructor
obsoleteCustomClassConstructorback to summary
private final Constructor<?> obsoleteCustomClassConstructor

Constructor Detail

DefaultResourceLeakDetectorFactoryback to summary
pack-priv DefaultResourceLeakDetectorFactory()

Method Detail

customClassConstructorback to summary
private static Constructor<?> customClassConstructor(String customLeakDetector)
newResourceLeakDetectorback to summary
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval, long maxActive)

Implements abstract io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

Parameters
<T>

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector. the type of the resource class

resource:Class<T>

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

the resource class used to initialize the ResourceLeakDetector

samplingInterval:int

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

the interval on which sampling takes place

maxActive:long

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

This is deprecated and will be ignored.

Returns:ResourceLeakDetector<T>

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

a new instance of ResourceLeakDetector

Annotations
@SuppressWarnings:deprecation
@Override
newResourceLeakDetectorback to summary
public <T> ResourceLeakDetector<T> newResourceLeakDetector(Class<T> resource, int samplingInterval)

Overrides io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

Doc from io.netty.util.ResourceLeakDetectorFactory.newResourceLeakDetector.

Returns a new instance of a ResourceLeakDetector with the given resource class.

Parameters
<T>
the type of the resource class
resource:Class<T>

the resource class used to initialize the ResourceLeakDetector

samplingInterval:int

the interval on which sampling takes place

Returns:ResourceLeakDetector<T>

a new instance of ResourceLeakDetector

Annotations
@Override
obsoleteCustomClassConstructorback to summary
private static Constructor<?> obsoleteCustomClassConstructor(String customLeakDetector)