public enum JavaGcCleanerWrapper extends Enum<JavaGcCleanerWrapper>
A clean operation can be wrapped with the Java GC Cleaner which will schedule this operation before GC is run for the given owner object (not reachable in user code). but only if the cleaner has not been already run explicitly by user before. If the cleaner is run after GC it will not run clean operation again. This way we guarantee that the clean operation will always run at some point but only once.
The wrapper looks up the underlying Java GC Cleaner class in different packages
限定符和类型 | 方法和说明 |
---|---|
static Runnable |
create(Object owner,
Runnable cleanOperation) |
static JavaGcCleanerWrapper |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static JavaGcCleanerWrapper[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static JavaGcCleanerWrapper[] values()
for (JavaGcCleanerWrapper c : JavaGcCleanerWrapper.values()) System.out.println(c);
public static JavaGcCleanerWrapper valueOf(String name)
name
- 要返回的枚举常量的名称。IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量NullPointerException
- 如果参数为空值Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.