public enum GlobalPruneTimer extends Enum<GlobalPruneTimer>
Enum Constant and Description |
---|
INSTANCE
单例对象
|
Modifier and Type | Method and Description |
---|---|
void |
create()
创建定时器
|
ScheduledFuture<?> |
schedule(Runnable task,
long delay)
启动定时任务
|
void |
shutdown()
销毁全局定时器
|
List<Runnable> |
shutdownNow()
销毁全局定时器
|
static GlobalPruneTimer |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static GlobalPruneTimer[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GlobalPruneTimer INSTANCE
public static GlobalPruneTimer[] values()
for (GlobalPruneTimer c : GlobalPruneTimer.values()) System.out.println(c);
public static GlobalPruneTimer valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic ScheduledFuture<?> schedule(Runnable task, long delay)
task
- 任务delay
- 周期ScheduledFuture
对象,可手动取消此任务public void create()
public void shutdown()
Copyright © 2024. All rights reserved.