public class ResourceLeakDetector<T>
extends java.lang.Object | Modifier and Type | Class and Description |
|---|---|
static class |
ResourceLeakDetector.Level
代表资源泄漏检测的级别。
|
| Constructor and Description |
|---|
ResourceLeakDetector(java.lang.Class<?> resourceType)
|
ResourceLeakDetector(java.lang.Class<?> resourceType, int samplingInterval)
这不应该由 ResourceLeakDetector的用户直接使用。
|
ResourceLeakDetector(java.lang.Class<?> resourceType, int samplingInterval, long maxActive)
|
ResourceLeakDetector(java.lang.String resourceType)
|
ResourceLeakDetector(java.lang.String resourceType, int samplingInterval, long maxActive)
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addExclusions(java.lang.Class clz, java.lang.String... methodNames) |
static ResourceLeakDetector.Level |
getLevel()
返回当前的资源泄漏检测级别。
|
static boolean |
isEnabled()
如果资源泄漏检测已启用,则返回
true 。
|
ResourceLeak |
open(T obj)
已过时。
|
protected void |
reportInstancesLeak(java.lang.String resourceType)
已过时。
此方法将不再由
ResourceLeakDetector调用。
|
protected void |
reportTracedLeak(java.lang.String resourceType, java.lang.String records)
当检测到跟踪泄漏时调用此方法。
|
protected void |
reportUntracedLeak(java.lang.String resourceType)
当检测到未捕获的泄漏时调用此方法。
|
static void |
setEnabled(boolean enabled)
已过时。
改为使用
setLevel(Level) 。
|
static void |
setLevel(ResourceLeakDetector.Level level)
设置资源泄漏检测级别。
|
ResourceLeakTracker<T> |
track(T obj)
创建一个新的 ResourceLeakTracker ,当相关资源解除分配时,预计将通过ResourceLeakTracker.close(Object)关闭该新的ResourceLeakTracker 。
|
@Deprecated public ResourceLeakDetector(java.lang.Class<?> resourceType)
@Deprecated public ResourceLeakDetector(java.lang.String resourceType)
@Deprecated
public ResourceLeakDetector(java.lang.Class<?> resourceType,
int samplingInterval,
long maxActive)
ResourceLeakDetector(Class, int) 。
这不应该由ResourceLeakDetector的用户直接使用。 请使用ResourceLeakDetectorFactory.newResourceLeakDetector(Class)或ResourceLeakDetectorFactory.newResourceLeakDetector(Class, int, long)
maxActive - 这已被弃用,将被忽略。
public ResourceLeakDetector(java.lang.Class<?> resourceType,
int samplingInterval)
@Deprecated
public ResourceLeakDetector(java.lang.String resourceType,
int samplingInterval,
long maxActive)
maxActive - 这是不赞成的,将被忽略。
@Deprecated public static void setEnabled(boolean enabled)
setLevel(Level) 。
public static boolean isEnabled()
true 。
public static void setLevel(ResourceLeakDetector.Level level)
public static ResourceLeakDetector.Level getLevel()
@Deprecated public final ResourceLeak open(T obj)
track(Object)
ResourceLeak ,当相关资源解除分配时,预计将通过ResourceLeak.close()关闭该新的ResourceLeak 。
ResourceLeak或null
public final ResourceLeakTracker<T> track(T obj)
ResourceLeakTracker ,当相关资源解除分配时,预计将通过ResourceLeakTracker.close(Object)关闭该新的ResourceLeakTracker 。
ResourceLeakTracker或null
protected void reportTracedLeak(java.lang.String resourceType,
java.lang.String records)
protected void reportUntracedLeak(java.lang.String resourceType)
@Deprecated protected void reportInstancesLeak(java.lang.String resourceType)
ResourceLeakDetector调用。
public static void addExclusions(java.lang.Class clz,
java.lang.String... methodNames) Copyright © 2008–2018 The Netty Project. All rights reserved.