public class ResourceLeakDetector<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceLeakDetector.Level
Represents the level of resource leak detection.
|
| Constructor and Description |
|---|
ResourceLeakDetector(Class<?> resourceType)
|
ResourceLeakDetector(Class<?> resourceType,
int samplingInterval,
long maxActive)
This should not be used directly by users of
ResourceLeakDetector. |
ResourceLeakDetector(String resourceType)
|
ResourceLeakDetector(String resourceType,
int samplingInterval,
long maxActive)
|
| Modifier and Type | Method and Description |
|---|---|
static ResourceLeakDetector.Level |
getLevel()
Returns the current resource leak detection level.
|
static boolean |
isEnabled()
Returns
true if resource leak detection is enabled. |
ResourceLeak |
open(T obj)
Deprecated.
use
track(Object) |
protected void |
reportInstancesLeak(String resourceType)
This method is called when instance leaks are detected.
|
protected void |
reportTracedLeak(String resourceType,
String records)
This method is called when a traced leak is detected.
|
protected void |
reportUntracedLeak(String resourceType)
This method is called when an untraced leak is detected.
|
static void |
setEnabled(boolean enabled)
Deprecated.
Use
setLevel(Level) instead. |
static void |
setLevel(ResourceLeakDetector.Level level)
Sets the resource leak detection level.
|
ResourceLeakTracker<T> |
track(T obj)
Creates a new
ResourceLeakTracker which is expected to be closed via
ResourceLeakTracker.close(Object) when the related resource is deallocated. |
@Deprecated public ResourceLeakDetector(Class<?> resourceType)
@Deprecated public ResourceLeakDetector(String resourceType)
public ResourceLeakDetector(Class<?> resourceType, int samplingInterval, long maxActive)
ResourceLeakDetector.
Please use ResourceLeakDetectorFactory.newResourceLeakDetector(Class)
or ResourceLeakDetectorFactory.newResourceLeakDetector(Class, int, long)@Deprecated public ResourceLeakDetector(String resourceType, int samplingInterval, long maxActive)
@Deprecated public static void setEnabled(boolean enabled)
setLevel(Level) instead.public static boolean isEnabled()
true if resource leak detection is enabled.public static void setLevel(ResourceLeakDetector.Level level)
public static ResourceLeakDetector.Level getLevel()
@Deprecated public final ResourceLeak open(T obj)
track(Object)ResourceLeak which is expected to be closed via ResourceLeak.close() when the
related resource is deallocated.ResourceLeak or nullpublic final ResourceLeakTracker<T> track(T obj)
ResourceLeakTracker which is expected to be closed via
ResourceLeakTracker.close(Object) when the related resource is deallocated.ResourceLeakTracker or nullprotected void reportTracedLeak(String resourceType, String records)
protected void reportUntracedLeak(String resourceType)
protected void reportInstancesLeak(String resourceType)
Copyright © 2008–2017 The Netty Project. All rights reserved.